Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def warp_flow(img, flow):
|
|
66 |
|
67 |
|
68 |
def warp(frame1, frame2, flo_path, blend=0.5, weights_path=None):
|
69 |
-
flo_path = flo_path.cpu().data.numpy()
|
70 |
flow21 = np.load(flo_path, allow_pickle=True)
|
71 |
frame1pil = np.array(frame1.convert('RGB').resize((flow21.shape[1],flow21.shape[0])))
|
72 |
frame1_warped21 = warp_flow(frame1pil, flow21)
|
@@ -175,7 +175,7 @@ def infer():
|
|
175 |
write_jpeg(flow_img, f"predicted_flow.jpg")
|
176 |
flo_file = write_flo(predicted_flow, "flofile.flo")
|
177 |
|
178 |
-
warp_res = warp(frames[100], frames[101],
|
179 |
return "done", "predicted_flow.jpg", ["flofile.flo"], warp_res
|
180 |
####################################
|
181 |
# Bonus: Creating GIFs of predicted flows
|
|
|
66 |
|
67 |
|
68 |
def warp(frame1, frame2, flo_path, blend=0.5, weights_path=None):
|
69 |
+
#flo_path = flo_path.cpu().data.numpy()
|
70 |
flow21 = np.load(flo_path, allow_pickle=True)
|
71 |
frame1pil = np.array(frame1.convert('RGB').resize((flow21.shape[1],flow21.shape[0])))
|
72 |
frame1_warped21 = warp_flow(frame1pil, flow21)
|
|
|
175 |
write_jpeg(flow_img, f"predicted_flow.jpg")
|
176 |
flo_file = write_flo(predicted_flow, "flofile.flo")
|
177 |
|
178 |
+
warp_res = warp(frames[100], frames[101], "flofile.flo", blend=0.5)
|
179 |
return "done", "predicted_flow.jpg", ["flofile.flo"], warp_res
|
180 |
####################################
|
181 |
# Bonus: Creating GIFs of predicted flows
|