Update app.py
Browse files
app.py
CHANGED
@@ -228,10 +228,14 @@ def infer():
|
|
228 |
# res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
|
229 |
res = cv2.remap(frame1pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
|
230 |
print(res)
|
|
|
231 |
res = Image.fromarray(res)
|
232 |
res.save('wraped.jpg')
|
233 |
-
|
|
|
|
|
234 |
image4.save("output2.jpg")
|
|
|
235 |
return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg', 'wraped.jpg', "output2.jpg"
|
236 |
####################################
|
237 |
# Bonus: Creating GIFs of predicted flows
|
|
|
228 |
# res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
|
229 |
res = cv2.remap(frame1pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
|
230 |
print(res)
|
231 |
+
|
232 |
res = Image.fromarray(res)
|
233 |
res.save('wraped.jpg')
|
234 |
+
|
235 |
+
blend2 = Image.open('frame_input.jpg')
|
236 |
+
image4 = Image.blend(res,blend2,0.5)
|
237 |
image4.save("output2.jpg")
|
238 |
+
|
239 |
return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg', 'wraped.jpg', "output2.jpg"
|
240 |
####################################
|
241 |
# Bonus: Creating GIFs of predicted flows
|