fffiloni commited on
Commit
ea75628
1 Parent(s): 7a51391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -227,7 +227,9 @@ def infer():
227
  # res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
228
  res = cv2.remap(frame1pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
229
  print(res)
230
- return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg'
 
 
231
  ####################################
232
  # Bonus: Creating GIFs of predicted flows
233
  # ---------------------------------------
@@ -256,4 +258,4 @@ def infer():
256
  # ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
257
 
258
 
259
- gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(), gr.Files(), gr.Image()]).launch()
 
227
  # res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
228
  res = cv2.remap(frame1pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
229
  print(res)
230
+ res = Image.fromarray(res)
231
+ res.save('wraped.jpg')
232
+ return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg', 'wraped.jpg'
233
  ####################################
234
  # Bonus: Creating GIFs of predicted flows
235
  # ---------------------------------------
 
258
  # ffmpeg -f image2 -framerate 30 -i predicted_flow_%d.jpg -loop -1 flow.gif
259
 
260
 
261
+ gr.Interface(fn=infer, inputs=[], outputs=[gr.Textbox(), gr.Image(), gr.Files(), gr.Image(), gr.Image()]).launch()