chiyoi commited on
Commit
93f622c
1 Parent(s): b0bdee4
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -36,13 +36,13 @@ def fn(video: gr.Video):
36
  if i % detect_object_frame_steps == 0:
37
  print(f'Detect object: Frame {i}')
38
  detections = detect_object(detector, frame)
 
39
  if len(frames) == classify_action_num_frames:
40
  print(f'Classify action: Until frame {i}')
41
  actions = classify_action(classifier, frames)
42
  frames = []
43
  frame = draw_boxes(frame, detections, actions)
44
  processed_frames.append(frame)
45
- yield frame, None
46
  processed_clip = ImageSequenceClip(processed_frames, clip.fps)
47
  processed_clip.audio = clip.audio
48
  processed_clip.write_videofile(output, fps=clip.fps, audio_codec='aac', logger=None)
 
36
  if i % detect_object_frame_steps == 0:
37
  print(f'Detect object: Frame {i}')
38
  detections = detect_object(detector, frame)
39
+ yield frame, None
40
  if len(frames) == classify_action_num_frames:
41
  print(f'Classify action: Until frame {i}')
42
  actions = classify_action(classifier, frames)
43
  frames = []
44
  frame = draw_boxes(frame, detections, actions)
45
  processed_frames.append(frame)
 
46
  processed_clip = ImageSequenceClip(processed_frames, clip.fps)
47
  processed_clip.audio = clip.audio
48
  processed_clip.write_videofile(output, fps=clip.fps, audio_codec='aac', logger=None)