yoga28v28/Video_temporal_error_detection
0
1def annotate_frame(frame, label):
2 import cv2
3
4 if label == "Frame Drop":
5 color = (0,0,255)
6 text = "DROP ⚠"
7 elif label == "Frame Merge":
8 color = (255,0,0)
9 text = "MERGE ⚠"
10 else:
11 color = (0,255,0)
12 text = "NORMAL"
13
14
15 # Bigger text
16 cv2.putText(frame, text, (30,60),
17 cv2.FONT_HERSHEY_SIMPLEX,
18 1.2, color, 3)
19
20 return frame