Update app.py
Browse files
app.py
CHANGED
@@ -63,12 +63,17 @@ def warp_image(im, flow):
|
|
63 |
im = [(img1 + 1) / 2 for img1 in im]
|
64 |
|
65 |
print(f"IMAGE: {im}")
|
66 |
-
im = im[0].cpu().data.numpy()
|
67 |
-
im = im.astype(np.float32)
|
|
|
|
|
|
|
68 |
print(f"IMAGE AP: {im}")
|
69 |
print(f"FLOW AV: {flow}")
|
70 |
-
flow = flow.cpu().data.numpy()
|
71 |
-
flow = flow.astype(np.float32)
|
|
|
|
|
72 |
print(f"FLOW AP: {flow}")
|
73 |
h, w = flow.shape[:2]
|
74 |
flow[:,:,0] += np.arange(w)
|
|
|
63 |
im = [(img1 + 1) / 2 for img1 in im]
|
64 |
|
65 |
print(f"IMAGE: {im}")
|
66 |
+
#im = im[0].cpu().data.numpy()
|
67 |
+
#im = im.astype(np.float32)
|
68 |
+
im = torch.FloatTensor(im).permute(0, 3, 1, 2).contiguous()
|
69 |
+
|
70 |
+
|
71 |
print(f"IMAGE AP: {im}")
|
72 |
print(f"FLOW AV: {flow}")
|
73 |
+
#flow = flow.cpu().data.numpy()
|
74 |
+
#flow = flow.astype(np.float32)
|
75 |
+
flow = torch.FloatTensor(flow)
|
76 |
+
|
77 |
print(f"FLOW AP: {flow}")
|
78 |
h, w = flow.shape[:2]
|
79 |
flow[:,:,0] += np.arange(w)
|