PNetRunner

class plugins.extract.detect.mtcnn.PNetRunner(weights_path: str, device: device, input_size: int, min_size: int, factor: float, threshold: float)

Bases: object

Runner for PyTorch P-Net model for MTCNN

Parameters:
  • weights_path (str) – The path to the torch model file

  • device (torch.device) – The device to use for model inference

  • input_size (int) – The input size of the model

  • min_size (int) – The minimum size of a face to accept as a detection. Default: 20

  • threshold (float) – Threshold for P-Net

  • factor (float)

Methods Summary

__call__(images)

first stage - fast proposal network (p-net) to obtain face candidates

Methods Documentation

__call__(images: ndarray) list[ndarray]

first stage - fast proposal network (p-net) to obtain face candidates

Parameters:

images (ndarray) – The batch of images to detect faces in

Return type:

List of face candidates from P-Net

__call__(images: ndarray) list[ndarray]

first stage - fast proposal network (p-net) to obtain face candidates

Parameters:

images (ndarray) – The batch of images to detect faces in

Return type:

List of face candidates from P-Net