roychao19477 commited on
Commit
9ecc54e
·
1 Parent(s): a9acc30

Upload to debug

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -163,6 +163,9 @@ def extract_resampled_audio(video_path, target_sr=16000):
163
  return resampled_audio_path
164
 
165
  @spaces.GPU
 
 
 
166
  def extract_faces(video_file):
167
  cap = cv2.VideoCapture(video_file)
168
  fps = cap.get(cv2.CAP_PROP_FPS)
@@ -174,7 +177,8 @@ def extract_faces(video_file):
174
  break
175
 
176
  # Inference
177
- results = model(frame, verbose=False)[0]
 
178
  for box in results.boxes:
179
  # version 1
180
  # x1, y1, x2, y2 = map(int, box.xyxy[0])
 
163
  return resampled_audio_path
164
 
165
  @spaces.GPU
166
+ def yolo_detection(frame, verbose=False):
167
+ return model(frame, verbose=verbose)[0]
168
+
169
  def extract_faces(video_file):
170
  cap = cv2.VideoCapture(video_file)
171
  fps = cap.get(cv2.CAP_PROP_FPS)
 
177
  break
178
 
179
  # Inference
180
+ #results = model(frame, verbose=False)[0]
181
+ results = yolo_detection(frame, verbose=False)
182
  for box in results.boxes:
183
  # version 1
184
  # x1, y1, x2, y2 = map(int, box.xyxy[0])