ml.postprocessing.mediapipe --- Google Mediapipe¶
ml.postprocessing.mediapipe モジュールには、Google Mediapipe モデル用の後処理クラスが含まれています。
class mediapipe_detection_postprocess -- 汎用 Mediapipe 検出器¶
BlazeFace と BlazePalm で共有される基底クラス。アンカーベースのバウンディングボックスとキーポイントをデコードし、その後 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_gridanchorsがNoneのときにアンカーを生成するために使用される(grid_size, scales)タプルのリスト。scoresスコアテンソルを含むモデル出力インデックスのリスト。cordsボックス/キーポイントテンソルを含むモデル出力インデックスのリスト。nms_threshold非最大抑制用の IoU しきい値。nms_sigmasoft-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_sigmasoft-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_sigmasoft-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_sigmasoft-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_sigmasoft-NMS のスコア減衰用のシグマ。__call__から[[((x, y, w, h), score, keypoints)]]を返します。利き手クラス(左=0、右=1)ごとに 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_sigmasoft-NMS のスコア減衰用のシグマ。__call__から((x, y, w, h), score, keypoints)タプルのリストを返します。keypointsは入力ピクセル座標における(x, y, score)点のリストです。