def process_frame(frame: np.ndarray, _) -> np.ndarray: detections = model.predict(frame, threshold=0.5) detections = detections[detections.class_id == 1] zone.trigger(detections=detections) labels = [f"{COCO_CLASSES[class_id]} {confidence:0.2f}" for class_id, confidence in zip(detections.class_id, detections.confidence)] frame = box_annotator.annotate(scene=frame, detections=detections) frame = label_annotator.annotate(scene=frame, detections=detections, labels=labels) frame = zone_annotator.annotate(scene=frame) return frame