RetinaFace ResNet-50 face detector

RetinaFace with a ResNet-50 backbone, exported for Facetorch face detection.

This repository contains immutable model artifacts used by Facetorch. Use the packaged Facetorch manifest to select a revision and artifact; do not treat mutable main or older unlisted files as a release contract.

Contract

Field Value
Model ID detector-retinaface
Architecture RetinaFace, ResNet-50 backbone
Input RGB image tensor converted to BGR, with spatial dimensions divisible by 32
Output Sequence of bounding-box regressions [batch, anchors, 4], class probabilities [batch, anchors, 2], and five-point landmark regressions [batch, anchors, 10].
Dynamic shapes Batch 1 for the release contract; height and width are dynamic multiples of 32.
Weights license MIT

Preprocessing: Convert RGB to BGR and subtract channel means [123, 117, 104]. Facetorch performs this preprocessing.

Release artifacts

File Format Runtime Devices SHA-256
model-torch2.6.pt2 pt2 >=2.6, <2.7 cpu, cuda 36ae7d95c4ae0f4faebc87d42ea9dbc55c9a030808c75725cb567d886cd09a11
model-torch2.11.pt2 pt2 >=2.11, <2.12 cpu, cuda 9541805b9b11d1fc6e329e365f010c310f5c3509b7d5e4236eb0797dfed66d01
model.pt torchscript >=2.6, <2.12 cpu 05e524af9b55bbf92b752b064c298f170ae763eb0ac0a4162a92e39fff007def

Facetorch v1 supports the Torch 2.6 and 2.11 cohort files listed in its manifest. The legacy TorchScript object is CPU-only and requires the explicit legacy opt-in. Files from unsupported cohorts are not part of the v1 release contract.

Loading the manifest-selected artifact

import torch
from huggingface_hub import hf_hub_download
from facetorch.artifacts import get_model_manifest

MODEL_ID = "detector-retinaface"
device = "cuda" if torch.cuda.is_available() else "cpu"
artifact = get_model_manifest().candidates(
    MODEL_ID,
    torch_version=torch.__version__,
    device=device,
    allow_legacy_models=False,
)[0]
path = hf_hub_download(
    repo_id=artifact.repo_id,
    revision=artifact.revision,
    filename=artifact.filename,
)
model = torch.export.load(path).module().to(device).eval()
example = torch.randn(1, 3, 480, 640, device=device)
with torch.inference_mode():
    output = model(example)

The random tensor above is only a loading smoke test. Use Facetorch's documented preprocessing for meaningful inference.

Provenance

Upstream Immutable revision Role License
https://github.com/biubug6/Pytorch_Retinaface b984b4b775b2c4dced95c1eadd195a5c7d32a60b checkpoint publisher and architecture source MIT
Upstream checkpoint SHA-256 Source
Resnet50_Final.pth 6d1de9c2944f2ccddca5f5e010ea5ae64a39845a86311af6fdf30841b0a5a16d publisher location

Mapping method: exact_tensor_equality_after_module_prefix_removal_and_torchscript_attribute_recovery.

Result: 456 of 456 tensors matched exactly; 219 legacy TorchScript state attributes were recovered without substitution.

The repository owner approved the mapping and redistribution record on 2026-08-23. Under the recorded policy, an author-published checkpoint in a permissively licensed repository with no separate checkpoint terms uses that repository license. MIT and Apache-2.0 have not been converted or treated as interchangeable. See LICENSE, THIRD_PARTY_NOTICES.md, and Facetorch's facetorch/models/governance.json.

Papers

Intended use

  • Research and assisted face localization with application-specific evaluation.

Limitations and responsible use

  • May miss, duplicate, or mislocalize faces under occlusion, extreme pose, small scale, or domain shift.
  • Detection performance is not evidence of equitable performance across populations or capture conditions.
  • The checkpoint license does not grant rights to upstream training datasets.
  • The artifact license does not itself license training datasets, input data, or a deployment's processing of personal data.
  • Do not use model output as the sole basis for consequential decisions about a person.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for tomas-gajarsky/facetorch-detector-retinaface