Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from utils.inference_router import process_video | |
| parameters = [ | |
| "Bridges", "Encroachment", "Structure Progress", | |
| "Potholes", "Crack", "Unauthorized Median Opening", | |
| "Crash Barriers", "Entry/Exit of Highway", "Drain", | |
| "Tree Height", "Latitude", "VARI" | |
| ] | |
| def detect(video, selected_params): | |
| return process_video(video, selected_params) | |
| with gr.Blocks() as app: | |
| gr.Markdown("## 🛣️ AI Road Surveillance Analyzer") | |
| video_input = gr.Video(label="Upload Surveillance Video") | |
| param_input = gr.CheckboxGroup(choices=parameters, label="Select Parameters") | |
| btn = gr.Button("Run Detection") | |
| output_gallery = gr.Gallery(label="Detection Results") | |
| btn.click(fn=detect, inputs=[video_input, param_input], outputs=output_gallery) | |
| app.launch() | |