LVFace
LVFace (ByteDance, ICCV 2025): face recognition: one 512-number descriptor per aligned 112x112 face crop; compare faces by cosine similarity. Four sizes (T, S, B, L). MIT code; non-commercial weights (Glint360K).
experimental Fork of bytedance/LVFace@80bd20c · backends: portable, kernels
- Paper LVFace: Progressive Cluster Optimization for Large Vision Models in Face Recognition ICCV 2025 · first released 23 Jan 2025
Paper 2025 Added in 0.4.0 Evaluated with 0.4.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import retrieval
model = retrieval.load("lvface-t") # fastest backend that runs here
result = model("photo.jpg")
# result fields: descriptor
descriptor = result.descriptor # a torch tensor
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["descriptor"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
retrieval.load("lvface-t", mode="kernels") # or "portable", "auto" (default) - Precision:
retrieval.load("lvface-t", dtype="float32") # full precision: slower, portable only
The weights are non-commercial: fastforks downloads them only with FASTFORKS_NONCOMMERCIAL=1 set.
fastforks bench lvface-t Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 480x640 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp32 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm | fp32 | 8.64 | – | 129 MiB/140 MiB | 1.6 | 0.45 |
| Original fp16torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm | fp16 | 8.65 | 1.00× | 146 MiB/160 MiB | 0.3 | 0.02 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 3.93 | 2.2× | 73 MiB/100 MiB | 0.2 | 0.24 |
| Kernels | fp16 | 3.38 | 2.6× | 73 MiB/102 MiB | 0.3 | 0.15 |
| Portable + torch.compile | 2.05 | 4.2× | 105 MiB/120 MiB | 7 (build) | – | |
| TensorRT fp16 | fp16 | 0.371 | 23× | 64 MiBenginenot comparable | 14 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28 to 2026-12-02. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Load / first call (s) | Output vs reference | Input |
|---|---|---|---|---|---|---|---|
| Apple silicon runs on macOS | |||||||
| Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-30 | Portable | fp16 | 5.74 | 281 MiB process | 0.2 / 0.1 | skip | 480x640 |
| Portable | fp32 | 6.44 | 516 MiB process | 0.8 / 0.1 | skip | 480x640 | |
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Non-commercial only
- Code
- MIT LICENSE
- Weights
- LicenseRef-noncommercial source
- Training data
-
- Glint360K (InsightFace: 17.1 M face images of 360k identities) noncommercial, non-commercial
- weights: LicenseRef-noncommercial
Our reading of the licences, not legal advice.
Weights
LVFace-T_Glint360K.pt 76.6 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download lvface-t). Non-commercial weights need FASTFORKS_NONCOMMERCIAL=1.
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
CALFW (cross-age LFW)
6000 official pairs, 10-fold verification accuracy / AUC %
| Run | dtype | acc ↑ | auc ↑ | Δ acc vs fp32 original | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 64.10 | 69.63 | reference | 6000 | 7.73 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 64.65 | 69.64 | +0.55 | 6000 | 3.74 |
| Portable | fp16 | 64.58 | 69.64 | +0.48 | 6000 | 3.54 |
| Kernels | not measured | |||||
Every query's descriptor against every database descriptor (cosine similarity, exact top-k on the GPU); a query counts as found at k when one of its k nearest database images is within 25 m (UTM positions of the file names), the standard visual place recognition protocol. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-30; portable fp32, portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks d1aa9702d, 2026-11-30.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output descriptor).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.02 | 0.00013 |
| GPU default dtypes, p99 |diff| | ≤ 0.25 | 0.00042 |
Recorded for lvface-t on RTX 5060 Ti, torch 2.14.1+cu130, 2026-12-02, with these kernels: fvm_conv
Details
LVFace (You et al., ICCV 2025 Highlight, ByteDance): face recognition with a plain vision transformer trained on Glint360K with progressive cluster optimisation. It turns an aligned face crop into a 512-d unit descriptor; the dot product of two descriptors is the cosine similarity used for face verification (same person or not) and face search. Sizes T / S / B / L (76 MB to 1 GB). The input is a face crop already aligned to the standard five-point template at 112 x 112 (the face detector and aligner are not part of the model; see the retinaface / yunet pose models for detection).
- Input / output
- Input: one RGB image. Output: a global descriptor
[D](unit L2 norm) for image retrieval / visual place recognition;fastforks.retrieval.top_kandpairsfind the nearest images (cosine similarity) on the GPU. - Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (483 MiB allocated)
- Outputs
descriptor- Checkpoint
embed=256,depth=12,heads=8- CUDA kernels
fvm_convfused convolutions for image classifiers
- Apple (MPS)
- fp32, fp16
Limitations
- Face crops only: the network expects a face aligned to the standard 112 x 112 five-point template (as insightface's `norm_crop`); whole photos or unaligned crops give unreliable descriptors. Detection and alignment are not part of the model.
- Weights are for non-commercial research use: the model card says MIT, but its README states the models are for non-commercial research only, and Glint360K itself (and models trained on it) is non-commercial research data per InsightFace. Listed as non-commercial (`LicenseRef-noncommercial`).
- The kernels backend (CUDA, fp16) accumulates the token GEMMs in fp16 and replays the network from a CUDA graph per batch size, captured on its second call; the first call of a new batch size runs eagerly.
Full reference, generated from the repository
LVFace (ByteDance, ICCV 2025): face recognition: one 512-number descriptor per aligned 112x112 face crop; compare faces by cosine similarity. Four sizes (T, S, B, L). MIT code; non-commercial weights (Glint360K).
Commercial use: no (weights: LicenseRef-noncommercial).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
lvface-t | synthetic (480x640) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 8.64 8.65 3.93 3.38 2.05 0.371 | 129 / 140 146 / 160 73 / 100 73 / 102 105 / 120 140 / 164 |
lvface-s | synthetic (480x640) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 8.76 9.18 4.05 3.39 2.22 0.756 | 400 / 406 472 / 486 182 / 210 183 / 232 214 / 230 344 / 368 |
lvface-b | synthetic (480x640) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 17.1 17.4 6.47 5.93 3.79 1.24 | 617 / 624 688 / 704 254 / 276 255 / 278 286 / 296 480 / 498 |
lvface-l | synthetic (480x640) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 17.4 18.2 6.89 6.52 4.28 2.00 | 1339 / 1350 1500 / 1510 526 / 546 527 / 546 558 / 566 1043 / 1058 |
Details
- Original code: https://github.com/bytedance/LVFace at
80bd20c8bb78 - Code licence: MIT (permissive); files:
LICENSE - Weights licence: LicenseRef-noncommercial
- Licence evidence: https://huggingface.co/bytedance-research/LVFace/blob/b12702ab1f5c721748e054a66dc90e1edd1f0724/README.md (metadata: license mit; License section: 'the models downloaded from our repo follow the above license policy (which is for non-commercial research purposes only)') ; https://github.com/deepinsight/insightface/blob/master/recognition/partial_fc/README.md (Glint360K licence)
- Training data: Glint360K (InsightFace: 17.1 M face images of 360k identities) (Trained on Glint360K (model table of the HF README); the dataset and the models trained on it are non-commercial research only (InsightFace).)
- Kernel libraries:
fvm_conv - Variants:
lvface-t,lvface-s,lvface-b,lvface-l - Outputs: descriptor
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
lvface-t3000x4000 (0.5 GiB peak allocated, 0.5 reserved);lvface-s3000x4000 (0.6 GiB peak allocated, 0.6 reserved);lvface-b3000x4000 (0.6 GiB peak allocated, 0.7 reserved);lvface-l3000x4000 (0.9 GiB peak allocated, 0.9 reserved) lvface-t480x640, first call: portable + torch.compile 7 s (cold Inductor cache), TensorRT fp16 14 s (ONNX + engine).lvface-s480x640, first call: portable + torch.compile 7 s (cold Inductor cache), TensorRT fp16 15 s (ONNX + engine).lvface-b480x640, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 20 s (ONNX + engine).lvface-l480x640, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).lvface-toriginal (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-toriginal 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-soriginal (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-soriginal 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-boriginal (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-boriginal 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-loriginal (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-loriginal 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normlvface-tload / first call: original 0.26 s / 0.021 s, portable 0.16 s / 0.241 s, kernels 0.33 s / 0.152 slvface-sload / first call: original 0.96 s / 0.012 s, portable 0.15 s / 0.008 s, kernels 0.54 s / 0.129 slvface-bload / first call: original 1.52 s / 0.02 s, portable 0.2 s / 0.007 s, kernels 0.7 s / 0.128 slvface-lload / first call: original 3.17 s / 0.022 s, portable 0.45 s / 0.011 s, kernels 0.95 s / 0.134 s- Protocol, median of 15 after 3 warm-up, uint8 CUDA input (synthetic float for bench_inputs), card defaults
Measured
Every query's descriptor against every database descriptor (cosine similarity, exact top-k on the GPU); a query counts as found at k when one of its k nearest database images is within 25 m (UTM positions of the file names), the standard visual place recognition protocol. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | portable | portable fp32 | note |
|---|---|---|---|---|---|
lvface-t | CALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC % | 64.10 / 69.63 | 64.58 / 69.64 | 64.65 / 69.64 | |
lvface-s | CALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC % | 69.47 / 75.78 | 69.28 / 75.78 | 69.45 / 75.78 | |
lvface-b | CALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC % | 78.17 / 84.92 | 78.20 / 84.92 | 78.15 / 84.92 | |
lvface-l | CALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC % | 78.58 / 84.82 | 78.58 / 84.82 | 78.52 / 84.82 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks d1aa9702d, 2026-11-30.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output descriptor).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
lvface-t | 0.00013 / 0.00042 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
lvface-s | 0.00018 / 0.00059 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
lvface-b | 0.00013 / 0.00046 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
lvface-l | 0.00011 / 0.00035 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
Limitations
- Face crops only: the network expects a face aligned to the standard 112 x 112 five-point template (as insightface's
norm_crop); whole photos or unaligned crops give unreliable descriptors. Detection and alignment are not part of the model. - Weights are for non-commercial research use: the model card says MIT, but its README states the models are for non-commercial research only, and Glint360K itself (and models trained on it) is non-commercial research data per InsightFace. Listed as non-commercial (
LicenseRef-noncommercial). - The kernels backend (CUDA, fp16) accumulates the token GEMMs in fp16 and replays the network from a CUDA graph per batch size, captured on its second call; the first call of a new batch size runs eagerly.
Example output
No example rendered for this checkpoint yet.