Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ def process_input(uploaded_file, youtube_link, image_url, sensitivity):
|
|
20 |
|
21 |
Returns a tuple:
|
22 |
(download_file_path, display_file_path, status_message, dummy_state)
|
23 |
-
(The dummy_state is used because Gradio requires the same number of outputs.)
|
24 |
"""
|
25 |
input_path = None
|
26 |
|
@@ -71,7 +70,7 @@ def process_input(uploaded_file, youtube_link, image_url, sensitivity):
|
|
71 |
except Exception as e:
|
72 |
return None, None, f"Error processing the file: {e}", ""
|
73 |
|
74 |
-
# Clean up
|
75 |
if ((youtube_link and youtube_link.strip()) or (image_url and image_url.strip())) and input_path and os.path.exists(input_path):
|
76 |
os.remove(input_path)
|
77 |
|
@@ -86,10 +85,10 @@ with gr.Blocks(css="""
|
|
86 |
}
|
87 |
""") as demo:
|
88 |
# Header with scaled image (25% width) and title.
|
89 |
-
gr.HTML("<div style='text-align:center;'><img src='/crowdresult.jpg' style='width:25%;'/></div>")
|
90 |
gr.Markdown("## Pose Detection with YOLO11-pose")
|
91 |
|
92 |
-
# Create two
|
93 |
with gr.Row():
|
94 |
# Left column: Input tabs and sensitivity slider.
|
95 |
with gr.Column(scale=1):
|
|
|
20 |
|
21 |
Returns a tuple:
|
22 |
(download_file_path, display_file_path, status_message, dummy_state)
|
|
|
23 |
"""
|
24 |
input_path = None
|
25 |
|
|
|
70 |
except Exception as e:
|
71 |
return None, None, f"Error processing the file: {e}", ""
|
72 |
|
73 |
+
# Clean up temporary input if it was downloaded.
|
74 |
if ((youtube_link and youtube_link.strip()) or (image_url and image_url.strip())) and input_path and os.path.exists(input_path):
|
75 |
os.remove(input_path)
|
76 |
|
|
|
85 |
}
|
86 |
""") as demo:
|
87 |
# Header with scaled image (25% width) and title.
|
88 |
+
gr.HTML("<div style='text-align:center;'><img src='/crowdresult.jpg' style='width:25%;'/></div>")
|
89 |
gr.Markdown("## Pose Detection with YOLO11-pose")
|
90 |
|
91 |
+
# Create a two-column layout.
|
92 |
with gr.Row():
|
93 |
# Left column: Input tabs and sensitivity slider.
|
94 |
with gr.Column(scale=1):
|