Feat/content analyser pro (#859)

* Update to Yolo powered content analyser

* Update to Yolo powered content analyser

* Fix typing

* Drop bounding boxes and NMS check

* Drop bounding boxes and NMS check

* Fix CI
This commit is contained in:
Henry Ruhs
2025-01-23 12:12:03 +01:00
committed by henryruhs
parent 87e3a80491
commit 0e6ee69c53
2 changed files with 56 additions and 41 deletions

View File

@@ -208,9 +208,9 @@ def estimate_face_angle(face_landmark_68 : FaceLandmark68) -> Angle:
return face_angle
def apply_nms(bounding_boxes : List[BoundingBox], face_scores : List[Score], score_threshold : float, nms_threshold : float) -> Sequence[int]:
def apply_nms(bounding_boxes : List[BoundingBox], scores : List[Score], score_threshold : float, nms_threshold : float) -> Sequence[int]:
normed_bounding_boxes = [ (x1, y1, x2 - x1, y2 - y1) for (x1, y1, x2, y2) in bounding_boxes ]
keep_indices = cv2.dnn.NMSBoxes(normed_bounding_boxes, face_scores, score_threshold = score_threshold, nms_threshold = nms_threshold)
keep_indices = cv2.dnn.NMSBoxes(normed_bounding_boxes, scores, score_threshold = score_threshold, nms_threshold = nms_threshold)
return keep_indices