Spaces:
Sleeping
Sleeping
Update ProcessVideo.py
Browse files- ProcessVideo.py +1 -13
ProcessVideo.py
CHANGED
@@ -47,20 +47,8 @@ def process_video(video_path):
|
|
47 |
break
|
48 |
|
49 |
frame = all_frames[frame_idx]
|
50 |
-
|
51 |
-
# Increase the font size
|
52 |
-
font_scale = 1.5 # You can adjust this for size
|
53 |
-
thickness = 3 # You can adjust this for thickness
|
54 |
-
|
55 |
-
# Get the text size for centering
|
56 |
-
text_size = cv2.getTextSize(label, cv2.FONT_HERSHEY_SIMPLEX, font_scale, thickness)[0]
|
57 |
-
|
58 |
-
# Calculate the position to center the text
|
59 |
-
text_x = (width - text_size[0]) // 2
|
60 |
-
text_y = (height + text_size[1]) // 2 # Adjust for vertical centering
|
61 |
-
|
62 |
# Add label to the frame in the center
|
63 |
-
cv2.putText(frame, label, (
|
64 |
|
65 |
out.write(frame)
|
66 |
frame_idx += 1
|
|
|
47 |
break
|
48 |
|
49 |
frame = all_frames[frame_idx]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
# Add label to the frame in the center
|
51 |
+
cv2.putText(frame, label, (100,100), cv2.FONT_HERSHEY_SIMPLEX, font_scale, color, thickness)
|
52 |
|
53 |
out.write(frame)
|
54 |
frame_idx += 1
|