File size: 561 Bytes
179bd59
 
 
 
 
 
 
 
 
 
 
 
72d54a5
 
179bd59
 
 
 
 
 
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 utils import extract_frames
from model import predict_defect

def analyze_video(video):
    frames = extract_frames(video.name)
    results = [predict_defect(frame) for frame in frames]
    return results

demo = gr.Interface(
    fn=analyze_video,
    inputs=gr.Video(label="Upload Drone Video"),
    outputs=gr.Gallery(label="Detected Road Defects")
,
    title="Drone-based Road Defect Detection",
    description="Upload drone footage to identify and highlight road surface defects."
)

if __name__ == "__main__":
    demo.launch()