ml.postprocessing.mediapipe --- Google Mediapipe

โมดูล ml.postprocessing.mediapipe มีตัวประมวลผลหลังการทำงานสำหรับโมเดล Google Mediapipe

class mediapipe_detection_postprocess -- Generic Mediapipe Detector

คลาสฐานที่ใช้ร่วมกันโดย BlazeFace และ BlazePalm ถอดรหัส bounding box และจุดสำคัญที่อิงตาม anchor จากนั้นทำ 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 ค่าขีดแบ่ง score ที่ใช้กับ logits ดิบก่อน sigmoid

anchors อาร์เรย์ anchor ที่สร้างไว้ล่วงหน้าแบบ optional ที่มี shape (N, 2) ประกอบด้วยจุดศูนย์กลาง (cx, cy) ที่ normalize เป็น [0, 1] หาก None จะสร้าง anchor จาก anchor_grid

anchor_grid รายการของ tuple (grid_size, scales) ที่ใช้สร้าง anchor เมื่อ anchors เป็น None

scores รายการดัชนีเอาต์พุตของโมเดลที่มีเทนเซอร์ score

cords รายการดัชนีเอาต์พุตของโมเดลที่มีเทนเซอร์ box/keypoint

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

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

รันการประมวลผลหลังการทำงานบนเอาต์พุตของโมเดลและคืนรายการของ tuple ((x, y, w, h), score, keypoints) คืนค่า tuple ว่าง () เมื่อไม่มีการตรวจจับใดผ่านค่าขีดแบ่ง score

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

ถอดรหัสและเพิ่ม bounding box จากคู่เอาต์พุต (score, cords) หนึ่งคู่ลงใน accumulator NMS ที่ส่งมา

class BlazeFace -- Face Detection

ประมวลผลเอาต์พุตของโมเดล 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 ใช้ anchor grid ของ [(16, 2), (8, 6)] พร้อม score outputs [1, 2] และ box outputs [0, 3]

threshold ค่าขีดแบ่ง score สำหรับการตรวจจับ

anchors อาร์เรย์ anchor ที่สร้างไว้ล่วงหน้าแบบ optional หากเป็น None จะสร้างอัตโนมัติ

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

คืนรายการของ tuple ((x, y, w, h), score, keypoints) จาก __call__ โดย keypoints คือรายการของจุด (x, y)

class BlazePalm -- Palm Detection

ประมวลผลเอาต์พุตของโมเดล 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 ใช้ anchor grid ของ [(24, 2), (12, 6)] พร้อม score outputs [0] และ box outputs [1]

threshold ค่าขีดแบ่ง score สำหรับการตรวจจับ

anchors อาร์เรย์ anchor ที่สร้างไว้ล่วงหน้าแบบ optional หากเป็น None จะสร้างอัตโนมัติ

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

คืนรายการของ tuple ((x, y, w, h), score, keypoints) จาก __call__ โดย keypoints คือรายการของจุด (x, y)

class FaceLandmarks -- Face Landmarks

ประมวลผลเอาต์พุตของโมเดล FaceLandmarks หลังการอนุมาน

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

สร้างตัวประมวลผลหลังการทำงาน FaceLandmarks

threshold ค่าขีดแบ่ง score (หลัง sigmoid) สำหรับยอมรับการตรวจจับ

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

คืนรายการของ tuple ((x, y, w, h), score, keypoints) จาก __call__ โดย keypoints คือรายการของจุด (x, y, z)

class HandLandmarks -- Hand Landmarks

ประมวลผลเอาต์พุตของโมเดล HandLandmarks หลังการอนุมาน

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

สร้างตัวประมวลผลหลังการทำงาน HandLandmarks

threshold ค่าขีดแบ่ง score สำหรับยอมรับการตรวจจับ

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

คืนค่า [[((x, y, w, h), score, keypoints)]] จาก __call__ โดยมีรายการภายในหนึ่งรายการต่อคลาส handedness (ซ้าย=0, ขวา=1) keypoints คือรายการของจุด (x, y, z) รายการคลาสว่างจะถูกเก็บไว้เพื่อให้ดัชนีของแต่ละรายการตรงกับดัชนีคลาส

class MoveNet -- Pose Estimation

ประมวลผลเอาต์พุตของโมเดล MoveNet single-pose หลังการอนุมาน

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

สร้างตัวประมวลผลหลังการทำงาน MoveNet

threshold ค่าขีดแบ่งความเชื่อมั่นต่อจุดสำคัญ จุดสำคัญที่ต่ำกว่าค่านี้จะถูกยกเว้นจาก bounding box และค่า score เฉลี่ย

nms_threshold ค่าขีดแบ่ง IoU สำหรับ non-maximum suppression

nms_sigma Sigma สำหรับการลด score แบบ soft-NMS

คืนรายการของ tuple ((x, y, w, h), score, keypoints) จาก __call__ โดย keypoints คือรายการของจุด (x, y, score) ในพิกัดพิกเซลอินพุต