Update app.py
Browse files
app.py
CHANGED
|
@@ -66,7 +66,8 @@ def write_flo(flow, filename):
|
|
| 66 |
|
| 67 |
def warp_flow(img, flow, mul=1.):
|
| 68 |
#img = np.array(img.convert('RGB'))
|
| 69 |
-
|
|
|
|
| 70 |
h, w = flow.shape[:2]
|
| 71 |
flow = flow.copy()
|
| 72 |
flow[:, :, 0] += np.arange(w)
|
|
@@ -82,11 +83,11 @@ def warp_flow(img, flow, mul=1.):
|
|
| 82 |
|
| 83 |
def get_warp_res(fname_image, fname_flow, fname_output='warped.png'):
|
| 84 |
print(f"FNAME IMAGE: {fname_image}")
|
| 85 |
-
im2 = imread(fname_image)
|
| 86 |
-
print(f"FNAME IMAGE READED: {im2.shape}")
|
| 87 |
flow = fname_flow.cpu().detach().numpy()
|
| 88 |
print(f"FNAME FLOW READED: {flow.shape}")
|
| 89 |
-
res = warp_flow(
|
| 90 |
|
| 91 |
def infer():
|
| 92 |
video_url = "https://download.pytorch.org/tutorial/pexelscom_pavel_danilyuk_basketball_hd.mp4"
|
|
|
|
| 66 |
|
| 67 |
def warp_flow(img, flow, mul=1.):
|
| 68 |
#img = np.array(img.convert('RGB'))
|
| 69 |
+
img = cv2.imread(img,mode='RGB')
|
| 70 |
+
#flow = np.load(flow)
|
| 71 |
h, w = flow.shape[:2]
|
| 72 |
flow = flow.copy()
|
| 73 |
flow[:, :, 0] += np.arange(w)
|
|
|
|
| 83 |
|
| 84 |
def get_warp_res(fname_image, fname_flow, fname_output='warped.png'):
|
| 85 |
print(f"FNAME IMAGE: {fname_image}")
|
| 86 |
+
#im2 = imread(fname_image)
|
| 87 |
+
#print(f"FNAME IMAGE READED: {im2.shape}")
|
| 88 |
flow = fname_flow.cpu().detach().numpy()
|
| 89 |
print(f"FNAME FLOW READED: {flow.shape}")
|
| 90 |
+
res = warp_flow(fname_image, flow, 1.)
|
| 91 |
|
| 92 |
def infer():
|
| 93 |
video_url = "https://download.pytorch.org/tutorial/pexelscom_pavel_danilyuk_basketball_hd.mp4"
|