import gradio as gr import argparse from main2 import main def count_vehicles(video): args = argparse.Namespace() args.config_path = "configs.yaml" args.source = "./data/Video.mp4" yield from main(args) # with gr.Blocks() as demo: # with gr.Row(): # gr.Textbox("./data/Video.mp4", label="Path to the video file.") # with gr.Row(): # gr.Image(height=736, width=1280, label="Output video.") # with gr.Row(): # gr.Textbox("0", label="Total incoming vehicles.") # gr.Textbox("0", label="Total frames.") # gr.Textbox("0", label="Total outgoing vehicles.") demo = gr.Interface( count_vehicles, inputs=gr.Textbox("./data/Video.mp4", label="Path to the video file."), outputs=gr.Image(height=736, width=1280, label="Output video.") ) demo.launch()