fffiloni commited on
Commit
5807124
·
1 Parent(s): c34fc9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -74,13 +74,16 @@ def infer():
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
 
@@ -170,7 +173,8 @@ def infer():
170
  transform = T.ToPILImage()
171
 
172
  # convert the tensor to PIL image using above transform
173
- img = transform(frames[1])
 
174
  img = img.resize((960, 520))
175
  # display the PIL image
176
  #img.show()
 
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
+ img1_batch = torch.stack(input_frame_1])
86
+ img2_batch = torch.stack(input_frame_2])
87
 
88
  print(f"FRAME AFTER stack: {img1_batch}")
89
 
 
173
  transform = T.ToPILImage()
174
 
175
  # convert the tensor to PIL image using above transform
176
+ #img = transform(frames[1])
177
+ img = transform(input_frame_2)
178
  img = img.resize((960, 520))
179
  # display the PIL image
180
  #img.show()