Skip to content

MTCNN

We are using facenet-pytorch to load pre-trained MTCNN model1, see https://github.com/timesler/facenet-pytorch.

Pre-trained models

mozuma.models.mtcnn.pretrained.torch_mtcnn

Pre-trained PyTorch's MTCNN face detection module by FaceNet

Parameters:

Name Type Description Default
thresholds Tuple[float, float, float]

MTCNN threshold hyperparameters

required
image_size Tuple[int, int]

Image size after pre-preprocessing

required
min_face_size int

Minimum face size in pixels

required
device torch.device

Torch device to initialise the model weights

required

Returns:

Type Description
TorchMTCNNModule

Pre-trained MTCNN model

Base model

The MTCNN model is an implementation of a TorchModel.

mozuma.models.mtcnn.modules.TorchMTCNNModule

MTCNN face detection module

Attributes:

Name Type Description
thresholds Tuple[float, float, float]

MTCNN threshold hyperparameters

image_size Tuple[int, int]

Image size after pre-preprocessing

min_face_size int

Minimum face size in pixels

device torch.device

Torch device to initialise the model weights

Provider store

See the stores documentation for usage.

mozuma.models.mtcnn.stores.FaceNetMTCNNStore

Pre-trained model states by Facenet for MTCNN

These are identified by training_id=facenet.


  1. K. Zhang, Z. Zhang, Z. Li, and Y. Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499–1503, Oct 2016. doi:10.1109/LSP.2016.2603342