Skip to content

MagFace

We are using the official implementation of MagFace1 in Pytorch. See https://github.com/IrvingMeng/MagFace.

Pre-trained models

mozuma.models.magface.pretrained.torch_magface

Pre-trained MagFace module

Parameters:

Name Type Description Default
device torch.device

Torch device to initialise the model weights

required
remove_bad_faces bool

Whether to remove the faces with bad quality from the output. This will replace features of bad faces with float("nan"). Defaults to False.

required
magnitude_threshold float

Threshold to remove bad quality faces. The higher the stricter. Defaults to 22.5.

required

Base models

The MagFace model is an implementation of a TorchModel.

mozuma.models.magface.modules.TorchMagFaceModule

MagFace face embeddings from MTCNN detected faces

The input dataset should return a tuple of image data and bounding box information

Attributes:

Name Type Description
device torch.device

Torch device to initialise the model weights

remove_bad_faces bool

Whether to remove the faces with bad quality from the output. This will replace features of bad faces with float("nan"). Defaults to False.

magnitude_threshold float

Threshold to remove bad quality faces. The higher the stricter. Defaults to 22.5.

Provider store

See the stores documentation for usage.

mozuma.models.magface.stores.MagFaceStore

Pre-trained model states by MagFace (https://github.com/IrvingMeng/MagFace)

These are identified by training_id=magface.


  1. Qiang Meng, Shichao Zhao, Zhida Huang, and Feng Zhou. Magface: a universal representation for face recognition and quality assessment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 14225–14234. June 2021.