fffiloni commited on
Commit
5bd181a
·
1 Parent(s): 5d16a9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -211,16 +211,10 @@ def infer():
211
  print(f"img1_batch dtype: {img1_batch.dtype}")
212
  #res = get_warp_res(img1_batch, "predicted_flow.jpg", 'warped.png')
213
 
214
- h, w = predicted_flow.shape[:2]
215
- flow = predicted_flow.copy()
216
- flow[:, :, 0] + np.arange(w)
217
- flow[:, :, 1] + np.arange(h)[:, np.newaxis]
218
- # print('flow stats', flow.max(), flow.min(), flow.mean())
219
- # print(flow)
220
- flow*1.
221
- # print('flow stats mul', flow.max(), flow.min(), flow.mean())
222
- # res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
223
- res = cv2.remap(img1_batch, flow, None, cv2.INTER_LANCZOS4)
224
 
225
  #print(res)
226
  return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg'
 
211
  print(f"img1_batch dtype: {img1_batch.dtype}")
212
  #res = get_warp_res(img1_batch, "predicted_flow.jpg", 'warped.png')
213
 
214
+ numpy_array_flow = predicted_flow.numpy()
215
+ print(f"numpy_array_flow: {numpy_array_flow}")
216
+ print(f"numpy_array_flow shape: {numpy_array_flow.shape}")
217
+ print(f"numpy_array_flow dtype: {numpy_array_flow.dtype}")
 
 
 
 
 
 
218
 
219
  #print(res)
220
  return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg'