goryhon commited on
Commit
ea368e8
·
verified ·
1 Parent(s): c7f5642

Update web-demos/hugging_face/app.py

Browse files
Files changed (1) hide show
  1. web-demos/hugging_face/app.py +0 -6
web-demos/hugging_face/app.py CHANGED
@@ -83,8 +83,6 @@ def get_frames_from_video(video_input, video_state):
83
  ret, frame = cap.read()
84
  if ret == True:
85
  original_h, original_w = frame.shape[:2]
86
- scale_factor = min(1, 1280/max(original_h, original_w))
87
- target_h, target_w = int(original_h*scale_factor), int(original_w*scale_factor)
88
  frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
89
  status_ok = False
90
  else:
@@ -93,10 +91,6 @@ def get_frames_from_video(video_input, video_state):
93
  if ret == True:
94
  # resize input image
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
 
83
  ret, frame = cap.read()
84
  if ret == True:
85
  original_h, original_w = frame.shape[:2]
 
 
86
  frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
87
  status_ok = False
88
  else:
 
91
  if ret == True:
92
  # resize input image
93
  original_h, original_w = frame.shape[:2]
 
 
 
 
94
  frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
95
  else:
96
  break