Spaces:
Sleeping
Sleeping
File size: 972 Bytes
eb376f2 d4dc4f2 eb376f2 3d0f1e4 d4dc4f2 f78faf6 d4dc4f2 f78faf6 d4dc4f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
from ProcessVideo import process_video
def gradio_video_processing(video, sequence_length=40, threshold=0.8, output_frame_rate=30):
output_video, json_response = process_video(video, sequence_length, threshold, output_frame_rate)
return output_video, json_response
video_input = gr.Video(label="Upload a Video")
sequence_length_slider = gr.Slider(minimum=10, maximum=100, step=1, value=40, label="Sequence Length")
threshold_slider = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.8, label="Detection Threshold")
frame_rate_slider = gr.Slider(minimum=10, maximum=60, step=1, value=30, label="Output Frame Rate")
video_output = gr.Video(label="Processed Video")
json_output = gr.JSON(label="Processing Results")
gr.Interface(
fn=gradio_video_processing,
inputs=[video_input, sequence_length_slider, threshold_slider, frame_rate_slider],
outputs=[video_output, json_output],
title="Fight Detection in Video"
).launch() |