fffiloni commited on
Commit
37dabf9
·
1 Parent(s): 6608c88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -87,7 +87,7 @@ def read_flo_file(filename):
87
 
88
  def warp(frame1, frame2, flo_path, blend=0.5, weights_path=None):
89
  #flo_path = flo_path.cpu().data.numpy()
90
- flow21 = read_flo_file(flo_path)
91
  frame1pil = np.array(frame1.convert('RGB').resize((flow21.shape[1],flow21.shape[0])))
92
  frame1_warped21 = warp_flow(frame1pil, flow21)
93
  # frame2pil = frame1pil
@@ -195,7 +195,7 @@ def infer():
195
  write_jpeg(flow_img, f"predicted_flow.jpg")
196
  flo_file = write_flo(predicted_flow, "flofile.flo")
197
 
198
- warp_res = warp(frames[100], frames[101], "flofile.flo", blend=0.5)
199
  return "done", "predicted_flow.jpg", ["flofile.flo"], warp_res
200
  ####################################
201
  # Bonus: Creating GIFs of predicted flows
 
87
 
88
  def warp(frame1, frame2, flo_path, blend=0.5, weights_path=None):
89
  #flo_path = flo_path.cpu().data.numpy()
90
+ flow21 = flo_path
91
  frame1pil = np.array(frame1.convert('RGB').resize((flow21.shape[1],flow21.shape[0])))
92
  frame1_warped21 = warp_flow(frame1pil, flow21)
93
  # frame2pil = frame1pil
 
195
  write_jpeg(flow_img, f"predicted_flow.jpg")
196
  flo_file = write_flo(predicted_flow, "flofile.flo")
197
 
198
+ warp_res = warp(frames[100], frames[101], predicted_flow, blend=0.5)
199
  return "done", "predicted_flow.jpg", ["flofile.flo"], warp_res
200
  ####################################
201
  # Bonus: Creating GIFs of predicted flows