Update app.py
Browse files
app.py
CHANGED
@@ -67,20 +67,20 @@ def write_flo(flow, filename):
|
|
67 |
|
68 |
|
69 |
def infer():
|
70 |
-
video_url = "https://download.pytorch.org/tutorial/pexelscom_pavel_danilyuk_basketball_hd.mp4"
|
71 |
-
video_path = Path(tempfile.mkdtemp()) / "basketball.mp4"
|
72 |
-
_ = urlretrieve(video_url, video_path)
|
73 |
|
74 |
-
frames, _, _ = read_video(str(
|
75 |
print(f"FRAME BEFORE stack: {frames[100]}")
|
76 |
|
77 |
-
input_frame_1 = read_image(str("./frame1.jpg"), ImageReadMode.UNCHANGED)
|
78 |
-
print(f"FRAME 1: {input_frame_1}")
|
79 |
-
input_frame_2 = read_image(str("./frame2.jpg"), ImageReadMode.UNCHANGED)
|
80 |
-
print(f"FRAME 1: {input_frame_2}")
|
81 |
|
82 |
-
img1_batch = torch.stack([
|
83 |
-
img2_batch = torch.stack([
|
84 |
|
85 |
print(f"FRAME AFTER stack: {img1_batch}")
|
86 |
|
|
|
67 |
|
68 |
|
69 |
def infer():
|
70 |
+
#video_url = "https://download.pytorch.org/tutorial/pexelscom_pavel_danilyuk_basketball_hd.mp4"
|
71 |
+
#video_path = Path(tempfile.mkdtemp()) / "basketball.mp4"
|
72 |
+
#_ = urlretrieve(video_url, video_path)
|
73 |
|
74 |
+
frames, _, _ = read_video(str("./spacex.mp4"), output_format="TCHW")
|
75 |
print(f"FRAME BEFORE stack: {frames[100]}")
|
76 |
|
77 |
+
#input_frame_1 = read_image(str("./frame1.jpg"), ImageReadMode.UNCHANGED)
|
78 |
+
#print(f"FRAME 1: {input_frame_1}")
|
79 |
+
#input_frame_2 = read_image(str("./frame2.jpg"), ImageReadMode.UNCHANGED)
|
80 |
+
#print(f"FRAME 1: {input_frame_2}")
|
81 |
|
82 |
+
img1_batch = torch.stack([frames[0]])
|
83 |
+
img2_batch = torch.stack([frames[1]])
|
84 |
|
85 |
print(f"FRAME AFTER stack: {img1_batch}")
|
86 |
|