Luo-Yihang commited on
Commit
c09c992
β€’
1 Parent(s): 0d1d760

debug code

Browse files
Files changed (1) hide show
  1. web-demos/hugging_face/app.py +2 -1
web-demos/hugging_face/app.py CHANGED
@@ -95,7 +95,8 @@ def get_frames_from_video(video_input, video_state):
95
  original_h, original_w = frame.shape[:2]
96
  scale_factor = min(1, 1280/max(original_h, original_w))
97
  target_h, target_w = int(original_h*scale_factor), int(original_w*scale_factor)
98
- # frame = cv2.resize(frame, (target_w, target_h))
 
99
  frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
100
  else:
101
  break
 
95
  original_h, original_w = frame.shape[:2]
96
  scale_factor = min(1, 1280/max(original_h, original_w))
97
  target_h, target_w = int(original_h*scale_factor), int(original_w*scale_factor)
98
+ if scale_factor != 1:
99
+ frame = cv2.resize(frame, (target_w, target_h))
100
  frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
101
  else:
102
  break