Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ import torch
|
|
| 25 |
from PIL import Image
|
| 26 |
import matplotlib.pyplot as plt
|
| 27 |
import torchvision.transforms.functional as F
|
| 28 |
-
from torchvision.io import read_video, read_image
|
| 29 |
from torchvision.models.optical_flow import Raft_Large_Weights
|
| 30 |
from torchvision.models.optical_flow import raft_large
|
| 31 |
from torchvision.io import write_jpeg
|
|
@@ -74,9 +74,9 @@ def infer():
|
|
| 74 |
frames, _, _ = read_video(str(video_path), output_format="TCHW")
|
| 75 |
print(f"FRAME BEFORE stack: {frames[100]}")
|
| 76 |
|
| 77 |
-
input_frame_1 = read_image(str("./frame1.jpg"), ImageReadMode
|
| 78 |
print(f"FRAME 1: {input_frame_1}")
|
| 79 |
-
input_frame_2 = read_image(str("./frame2.jpg"), ImageReadMode
|
| 80 |
print(f"FRAME 1: {input_frame_2}")
|
| 81 |
|
| 82 |
img1_batch = torch.stack([frames[100]])
|
|
|
|
| 25 |
from PIL import Image
|
| 26 |
import matplotlib.pyplot as plt
|
| 27 |
import torchvision.transforms.functional as F
|
| 28 |
+
from torchvision.io import read_video, read_image, ImageReadMode
|
| 29 |
from torchvision.models.optical_flow import Raft_Large_Weights
|
| 30 |
from torchvision.models.optical_flow import raft_large
|
| 31 |
from torchvision.io import write_jpeg
|
|
|
|
| 74 |
frames, _, _ = read_video(str(video_path), 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[100]])
|