Spaces:
Sleeping
Sleeping
modify parameters
Browse files- app.py +2 -1
- configurations.py +2 -1
app.py
CHANGED
@@ -36,13 +36,14 @@ 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 |
-
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)
|
|
|
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 |
+
if i % yield_frame_steps == 0:
|
46 |
+
yield frame, None
|
47 |
processed_clip = ImageSequenceClip(processed_frames, clip.fps)
|
48 |
processed_clip.audio = clip.audio
|
49 |
processed_clip.write_videofile(output, fps=clip.fps, audio_codec='aac', logger=None)
|
configurations.py
CHANGED
@@ -31,9 +31,10 @@ checkpoint_dir = f'storage/pretrained_weights/movinet_{model_id}_base'
|
|
31 |
num_classes = 6
|
32 |
|
33 |
# Inference
|
34 |
-
detect_object_frame_steps =
|
35 |
classify_action_frame_steps = 15
|
36 |
classify_action_num_frames = 8
|
|
|
37 |
|
38 |
# Train
|
39 |
train_id = 8
|
|
|
31 |
num_classes = 6
|
32 |
|
33 |
# Inference
|
34 |
+
detect_object_frame_steps = 10
|
35 |
classify_action_frame_steps = 15
|
36 |
classify_action_num_frames = 8
|
37 |
+
yield_frame_steps = 5
|
38 |
|
39 |
# Train
|
40 |
train_id = 8
|