Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,8 +46,13 @@ def process_video(video_path, output_option):
|
|
46 |
if not matched_mp4_files:
|
47 |
raise Exception(f"No .mp4 video files found in directory {output_dir} after conversion for {video_name}.")
|
48 |
|
49 |
-
#
|
50 |
-
object_count =
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
# Determine the output based on user's choice
|
53 |
if output_option == "Count":
|
|
|
46 |
if not matched_mp4_files:
|
47 |
raise Exception(f"No .mp4 video files found in directory {output_dir} after conversion for {video_name}.")
|
48 |
|
49 |
+
# Initialize object count
|
50 |
+
object_count = 0
|
51 |
+
|
52 |
+
# Calculate object count based on results
|
53 |
+
for result in results:
|
54 |
+
if hasattr(result, 'boxes'):
|
55 |
+
object_count += len(result.boxes)
|
56 |
|
57 |
# Determine the output based on user's choice
|
58 |
if output_option == "Count":
|