Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def count_unique_people(video_path):
|
|
86 |
class_id = int(box.cls.item()) # Get class ID
|
87 |
confidence = float(box.conf.item()) # Get confidence score
|
88 |
|
89 |
-
# Track only
|
90 |
if class_id == PEOPLE_CLASS_ID and confidence > CONFIDENCE_THRESHOLD:
|
91 |
x1, y1, x2, y2 = map(int, box.xyxy[0]) # Get bounding box
|
92 |
detections.append([x1, y1, x2, y2, confidence])
|
@@ -119,7 +119,7 @@ def count_unique_people(video_path):
|
|
119 |
|
120 |
else:
|
121 |
# If people is not in history, add it
|
122 |
-
people_history[
|
123 |
"frame_count": frame_count,
|
124 |
"position": people_center
|
125 |
}
|
|
|
86 |
class_id = int(box.cls.item()) # Get class ID
|
87 |
confidence = float(box.conf.item()) # Get confidence score
|
88 |
|
89 |
+
# Track only people
|
90 |
if class_id == PEOPLE_CLASS_ID and confidence > CONFIDENCE_THRESHOLD:
|
91 |
x1, y1, x2, y2 = map(int, box.xyxy[0]) # Get bounding box
|
92 |
detections.append([x1, y1, x2, y2, confidence])
|
|
|
119 |
|
120 |
else:
|
121 |
# If people is not in history, add it
|
122 |
+
people_history[people_id] = {
|
123 |
"frame_count": frame_count,
|
124 |
"position": people_center
|
125 |
}
|