ml.postprocessing.mediapipe — Google Mediapipe

ml.postprocessing.mediapipe 모듈은 Google Mediapipe 모델을 위한 후처리기를 포함합니다.

class mediapipe_detection_postprocess – 범용 Mediapipe 검출기

BlazeFaceBlazePalm 이 공유하는 기본 클래스입니다. 앵커 기반 경계 상자와 키포인트를 디코딩한 다음 NMS를 수행합니다.

class ml.postprocessing.mediapipe.mediapipe_detection_postprocess(threshold: float = 0.6, anchors: ndarray | None = None, anchor_grid: list[tuple[int, int]] | None = None, scores: list[int] = [], cords: list[int] = [], nms_threshold: float = 0.1, nms_sigma: float = 0.1)

범용 Mediapipe 검출 후처리기를 생성합니다.

threshold 시그모이드 이전에 원시 로짓에 적용되는 점수 임계값입니다.

anchors [0, 1] 로 정규화된 (cx, cy) 중심을 담고 있는 (N, 2) 형태의 선택적 사전 구축 앵커 배열입니다. None 이면 anchor_grid 로부터 앵커가 생성됩니다.

anchor_grid anchorsNone 일 때 앵커를 생성하는 데 사용되는 (grid_size, scales) 튜플 목록입니다.

scores 점수 텐서를 포함하는 모델 출력 인덱스 목록입니다.

cords 박스/키포인트 텐서를 포함하는 모델 출력 인덱스 목록입니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__(model: ml.Model, inputs: list, outputs: list) list

모델 출력에 대해 후처리를 실행하고 ((x, y, w, h), score, keypoints) 튜플 목록을 반환합니다. 점수 임계값을 통과하는 검출이 없으면 빈 튜플 () 을 반환합니다.

detection_post_process(ih: int, iw: int, nms: ml.utils.NMS, model: ml.Model, inputs: list, outputs: list, score_idx: int, cords_idx: int, t: float, anchors: ndarray) None

단일 (score, cords) 출력 쌍에서 경계 상자를 디코딩하여 제공된 NMS 누적기에 추가합니다.

class BlazeFace – 얼굴 검출

BlazeFace 모델 출력을 후처리합니다.

class ml.postprocessing.mediapipe.BlazeFace(threshold: float = 0.6, anchors: ndarray | None = None, nms_threshold: float = 0.1, nms_sigma: float = 0.1)

BlazeFace 후처리기를 생성합니다. 점수 출력 [1, 2] 와 박스 출력 [0, 3] 을 가진 [(16, 2), (8, 6)] 앵커 그리드를 사용합니다.

threshold 검출에 대한 점수 임계값입니다.

anchors 선택적 사전 구축 앵커 배열입니다. None 이면 자동으로 생성됩니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__ 에서 ((x, y, w, h), score, keypoints) 튜플 목록을 반환하며, 여기서 keypoints(x, y) 점들의 목록입니다.

class BlazePalm – 손바닥 검출

BlazePalm 모델 출력을 후처리합니다.

class ml.postprocessing.mediapipe.BlazePalm(threshold: float = 0.6, anchors: ndarray | None = None, nms_threshold: float = 0.1, nms_sigma: float = 0.1)

BlazePalm 후처리기를 생성합니다. 점수 출력 [0] 과 박스 출력 [1] 을 가진 [(24, 2), (12, 6)] 앵커 그리드를 사용합니다.

threshold 검출에 대한 점수 임계값입니다.

anchors 선택적 사전 구축 앵커 배열입니다. None 이면 자동으로 생성됩니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__ 에서 ((x, y, w, h), score, keypoints) 튜플 목록을 반환하며, 여기서 keypoints(x, y) 점들의 목록입니다.

class FaceLandmarks – 얼굴 랜드마크

FaceLandmarks 모델 출력을 후처리합니다.

class ml.postprocessing.mediapipe.FaceLandmarks(threshold: float = 0.6, nms_threshold: float = 0.1, nms_sigma: float = 0.1)

FaceLandmarks 후처리기를 생성합니다.

threshold 검출을 수락하기 위한 점수 임계값(시그모이드 이후)입니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__ 에서 ((x, y, w, h), score, keypoints) 튜플 목록을 반환하며, 여기서 keypoints(x, y, z) 점들의 목록입니다.

class HandLandmarks – 손 랜드마크

HandLandmarks 모델 출력을 후처리합니다.

class ml.postprocessing.mediapipe.HandLandmarks(threshold: float = 0.6, nms_threshold: float = 0.1, nms_sigma: float = 0.1)

HandLandmarks 후처리기를 생성합니다.

threshold 검출을 수락하기 위한 점수 임계값입니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__ 에서 [[((x, y, w, h), score, keypoints)]] 을 반환하며, 손 방향 클래스(왼손=0, 오른손=1)당 하나의 내부 목록을 갖습니다. keypoints(x, y, z) 점들의 목록입니다. 각 목록의 인덱스가 클래스 인덱스와 일치하도록 빈 클래스 목록은 유지됩니다.

class MoveNet – 자세 추정

MoveNet 단일 자세 모델 출력을 후처리합니다.

class ml.postprocessing.mediapipe.MoveNet(threshold: float = 0.6, nms_threshold: float = 0.1, nms_sigma: float = 0.1)

MoveNet 후처리기를 생성합니다.

threshold 키포인트별 신뢰도 임계값입니다. 이 값 미만의 키포인트는 경계 상자 및 평균 점수에서 제외됩니다.

nms_threshold 비최대 억제에 사용되는 IoU 임계값입니다.

nms_sigma soft-NMS 점수 감쇠에 사용되는 시그마입니다.

__call__ 에서 ((x, y, w, h), score, keypoints) 튜플 목록을 반환하며, 여기서 keypoints 는 입력 픽셀 좌표에서의 (x, y, score) 점들의 목록입니다.