Spaces:
Runtime error
Runtime error
Update services/video_service.py
Browse files- services/video_service.py +11 -11
services/video_service.py
CHANGED
|
@@ -21,17 +21,17 @@ class VideoService:
|
|
| 21 |
return Image.fromarray(frame_rgb)
|
| 22 |
|
| 23 |
def draw_detections(self, frame, detections):
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
for detection in detections:
|
| 36 |
score = detection["score"]
|
| 37 |
label = detection["label"]
|
|
|
|
| 21 |
return Image.fromarray(frame_rgb)
|
| 22 |
|
| 23 |
def draw_detections(self, frame, detections):
|
| 24 |
+
frame_copy = frame.copy()
|
| 25 |
+
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 26 |
+
cv2.putText(
|
| 27 |
+
frame_copy,
|
| 28 |
+
timestamp,
|
| 29 |
+
(10, 30),
|
| 30 |
+
cv2.FONT_HERSHEY_SIMPLEX,
|
| 31 |
+
0.7,
|
| 32 |
+
(255, 255, 255),
|
| 33 |
+
2
|
| 34 |
+
)
|
| 35 |
for detection in detections:
|
| 36 |
score = detection["score"]
|
| 37 |
label = detection["label"]
|