CoolFace
Apppublic

yoga28v28/Video_temporal_error_detection

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes
visualizer.py20 linesDownload Raw Back to root
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