Spaces:
Runtime error
Runtime error
import os | |
import gradio as gr | |
from inference import inference | |
input_video = gr.Video(mirror_webcam=False) | |
dd_model = gr.Dropdown(choices=["YoloV7", "YoloV7 Tiny"], value="YoloV7", label="Model") | |
cb_motion_estimation = gr.Checkbox(value=True, label="Track camera movement") | |
features = gr.CheckboxGroup( | |
choices=["Track camera movement", "Draw objects paths"], | |
value=["Track camera movement", "Draw objects paths"], | |
label="Features", | |
type="index" | |
) | |
cb_path_draw = gr.Checkbox(value=True, label="Draw objects paths") | |
dd_track_points = gr.Dropdown( | |
choices=["Bounding box", "Centroid"], value="Bounding box", label="Detections style" | |
) | |
slide_threshold = gr.Slider(minimum=0, maximum=1, value=0.25, label="Model confidence threshold") | |
# examples_folder = "examples" | |
# examples_list = [] | |
# if os.path.isdir(examples_folder): | |
# for file in os.listdir(examples_folder): | |
# path = examples_folder + "/" + file | |
# examples_list.append([path]) | |
output_component = "playablevideo" | |
iface = gr.Interface( | |
fn=inference, | |
inputs=[ | |
input_video, | |
dd_model, | |
features, | |
dd_track_points, | |
slide_threshold, | |
], | |
outputs=output_component, | |
) | |
iface.launch() | |