Downloads · 30 days
4
7% of all-time downloads
FrancescoMrn/cnn-fkp-deep
cnn-fkp-deep is a keypoint detection model from FrancescoMrn. Use it for the keypoint detection task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
68-point facial keypoint regression, in the iBUG 300-W landmark ordering.
Downloads · 30 days
4
7% of all-time downloads
All-time downloads
59
Public
Parameters
9.3M
185 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors37.1 MB · 100%
From the Hugging Face model README
68-point facial keypoint regression, in the iBUG 300-W landmark ordering.
224x224 face crop, scaled to [0, 1],
shape (N, 1, H, W).(N, 136) — 68 (x, y) pairs, normalised to [-0.5, 0.5] relative to the
crop. Multiply by the crop size and add half of it to get pixels.from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from fkp.models import build_model
path = hf_hub_download("FrancescoMrn/cnn-fkp-deep", "model.safetensors")
model = build_model("deep_cnn")
model.load_state_dict(load_file(path))
model.eval()
Or, with this repository installed, fkp resolves the config automatically:
from fkp.hub import load_from_hub
model, meta = load_from_hub("FrancescoMrn/cnn-fkp-deep")
Validation NME 0.0974 — mean landmark error as a fraction of the inter-ocular distance. Lower is better; 0.05 means the average landmark sits 5% of the distance between the outer eye corners away from its target.
| region | NME |
|---|---|
| jaw | 0.1281 |
| left_brow | 0.1019 |
| right_brow | 0.0975 |
| mouth | 0.0884 |
| nose | 0.0823 |
| left_eye | 0.0798 |
| right_eye | 0.0772 |
The jaw is 17 of the 68 points and is consistently the hardest region, so it dominates the overall average.
| architecture | deep_cnn |
| optimiser | adamw @ lr 0.001 |
| loss | mse |
| schedule | cosine |
| initialisation | kaiming |
| batch size | 64 |
| epochs | 200 |
| seed | 0 |
| split | 2766 train / 696 validation images |
| identities | 278 / 69, no overlap |
The validation split holds out whole identities. The images are YouTube Faces frames, with roughly ten frames per person, so a random split would put near-duplicate frames of the same face on both sides and measure memorisation rather than generalisation.
Trained on the Udacity extract of the YouTube Faces Database, annotated with 68 landmarks. The dataset is not demographically balanced, and the model inherits that. It expects a reasonably frontal, already-detected face crop; performance on profile views, heavy occlusion or unusual lighting is untested.
Research and educational use.