File size: 1,065 Bytes
acfe633
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
from reid_processor import process_reid_video
import os

# Define the Gradio interface
iface = gr.Interface(
    fn=process_reid_video,
    inputs=gr.Video(label="Upload a 15-second football video (e.g., 720p"),
    outputs=[
        gr.Video(
            label="Processed Video with Re-identified Players",
            format="mp4"  # Explicitly set the output format
        )
    ],
    title="Football Player Re-identification in a Single Feed",
    description=(
        "Upload a 15-second football video (e.g., 720p). "
        "This application uses a fine-tuned YOLOv11 model to detect players and then "
        "tracks them, ensuring consistent IDs even if players temporarily leave and re-enter the frame. "
        "The output video will show players boxed with their unique, persistent IDs."
    ),
    examples=[],
    allow_flagging="auto",
    live=False
)

# Launch with API docs disabled if needed
if __name__ == "__main__":
    print("Launching Gradio app...")
    iface.launch(show_api=False)  # Temporarily disable API docs