Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,7 @@ def count_people_video(video_path):
|
|
83 |
|
84 |
def analyze_video(video_file):
|
85 |
# Extract video path from uploaded file
|
86 |
-
video_path = video_file
|
87 |
|
88 |
# Ensure path exists
|
89 |
if not os.path.exists(video_path):
|
@@ -100,7 +100,7 @@ def analyze_image(image):
|
|
100 |
# Gradio Interface for Image Processing
|
101 |
image_interface = gr.Interface(
|
102 |
fn=analyze_image,
|
103 |
-
inputs=gr.Image(
|
104 |
outputs=[gr.Image(label="Processed Image"), gr.Textbox(label="People Counting Results")],
|
105 |
title="YOLO People Counter (Image)",
|
106 |
description="Upload an image to detect and count people using YOLOv3."
|
@@ -109,7 +109,7 @@ image_interface = gr.Interface(
|
|
109 |
# Gradio Interface for Video Processing
|
110 |
video_interface = gr.Interface(
|
111 |
fn=analyze_video,
|
112 |
-
inputs=gr.Video(
|
113 |
outputs=gr.Textbox(label="People Counting Results"),
|
114 |
title="YOLO People Counter (Video)",
|
115 |
description="Upload a video to detect and count people using YOLOv3."
|
|
|
83 |
|
84 |
def analyze_video(video_file):
|
85 |
# Extract video path from uploaded file
|
86 |
+
video_path = video_file.name # No need for `type="file"`
|
87 |
|
88 |
# Ensure path exists
|
89 |
if not os.path.exists(video_path):
|
|
|
100 |
# Gradio Interface for Image Processing
|
101 |
image_interface = gr.Interface(
|
102 |
fn=analyze_image,
|
103 |
+
inputs=gr.Image(label="Upload Image"),
|
104 |
outputs=[gr.Image(label="Processed Image"), gr.Textbox(label="People Counting Results")],
|
105 |
title="YOLO People Counter (Image)",
|
106 |
description="Upload an image to detect and count people using YOLOv3."
|
|
|
109 |
# Gradio Interface for Video Processing
|
110 |
video_interface = gr.Interface(
|
111 |
fn=analyze_video,
|
112 |
+
inputs=gr.Video(label="Upload Video"), # Remove `type="file"`
|
113 |
outputs=gr.Textbox(label="People Counting Results"),
|
114 |
title="YOLO People Counter (Video)",
|
115 |
description="Upload a video to detect and count people using YOLOv3."
|