Update app.py
Browse files
app.py
CHANGED
@@ -248,11 +248,11 @@ def infer():
|
|
248 |
|
249 |
h, w = numpy_array_flow.shape[:2]
|
250 |
numpy_array_flow = numpy_array_flow.copy()
|
251 |
-
numpy_array_flow[:, :, 0]
|
252 |
-
numpy_array_flow[:, :, 1]
|
253 |
# print('flow stats', flow.max(), flow.min(), flow.mean())
|
254 |
# print(flow)
|
255 |
-
numpy_array_flow
|
256 |
# print('flow stats mul', flow.max(), flow.min(), flow.mean())
|
257 |
# res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
|
258 |
res = cv2.remap(frame2pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
|
|
|
248 |
|
249 |
h, w = numpy_array_flow.shape[:2]
|
250 |
numpy_array_flow = numpy_array_flow.copy()
|
251 |
+
numpy_array_flow[:, :, 0] += np.arange(w)
|
252 |
+
numpy_array_flow[:, :, 1] += np.arange(h)[:, np.newaxis]
|
253 |
# print('flow stats', flow.max(), flow.min(), flow.mean())
|
254 |
# print(flow)
|
255 |
+
numpy_array_flow*=1.
|
256 |
# print('flow stats mul', flow.max(), flow.min(), flow.mean())
|
257 |
# res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
|
258 |
res = cv2.remap(frame2pil, numpy_array_flow, None, cv2.INTER_LANCZOS4)
|