Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +24 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from utils.inference_router import process_video
|
3 |
+
|
4 |
+
parameters = [
|
5 |
+
"Bridges", "Encroachment", "Structure Progress",
|
6 |
+
"Potholes", "Crack", "Unauthorized Median Opening",
|
7 |
+
"Crash Barriers", "Entry/Exit of Highway", "Drain",
|
8 |
+
"Tree Height", "Latitude", "VARI"
|
9 |
+
]
|
10 |
+
|
11 |
+
def detect(video, selected_params):
|
12 |
+
return process_video(video, selected_params)
|
13 |
+
|
14 |
+
with gr.Blocks() as app:
|
15 |
+
gr.Markdown("## 🛣️ AI Road Surveillance Analyzer")
|
16 |
+
|
17 |
+
video_input = gr.Video(label="Upload Surveillance Video")
|
18 |
+
param_input = gr.CheckboxGroup(choices=parameters, label="Select Parameters")
|
19 |
+
btn = gr.Button("Run Detection")
|
20 |
+
output_gallery = gr.Gallery(label="Detection Results")
|
21 |
+
|
22 |
+
btn.click(fn=detect, inputs=[video_input, param_input], outputs=output_gallery)
|
23 |
+
|
24 |
+
app.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
opencv-python
|
3 |
+
torch
|
4 |
+
numpy
|