fffiloni commited on
Commit
5ab4bff
·
1 Parent(s): d60ba1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -78,7 +78,7 @@ def warpImage(im, vx, vy, cast_uint8=True):
78
  xx, yy = np.meshgrid(x, y)
79
  XX, YY = np.meshgrid(X, Y)
80
  #XX = XX + vx
81
- XX = np.concatenate([XX, vx], axis = 1)
82
  #YY = YY + vy
83
  YY = np.concatenate([YY, vy], axis = 1)
84
  mask = (XX < 1) | (XX > width2) | (YY < 1) | (YY > height2)
@@ -207,12 +207,12 @@ def infer():
207
  transform = T.ToPILImage()
208
 
209
  # convert the tensor to PIL image using above transform
210
- img = transform(img1_batch[0])
211
 
212
  # display the PIL image
213
  #img.show()
214
  img.save('frame_input.jpg')
215
- #res = get_warp_res("frame_input.jpg", predicted_flow, fname_output='warped.png')
216
  #print(res)
217
  return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg'
218
  ####################################
 
78
  xx, yy = np.meshgrid(x, y)
79
  XX, YY = np.meshgrid(X, Y)
80
  #XX = XX + vx
81
+ XX = np.concatenate([XX, vx], axis = 0)
82
  #YY = YY + vy
83
  YY = np.concatenate([YY, vy], axis = 1)
84
  mask = (XX < 1) | (XX > width2) | (YY < 1) | (YY > height2)
 
207
  transform = T.ToPILImage()
208
 
209
  # convert the tensor to PIL image using above transform
210
+ img = transform(frames[100])
211
 
212
  # display the PIL image
213
  #img.show()
214
  img.save('frame_input.jpg')
215
+ res = get_warp_res("frame_input.jpg", predicted_flow, fname_output='warped.png')
216
  #print(res)
217
  return "done", "predicted_flow.jpg", ["flofile.flo"], 'frame_input.jpg'
218
  ####################################