Models · Image retrieval

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

Checkpoint

Paper 2025 Added in 0.4.0 Evaluated with 0.4.0

Kernels, RTX 5060 Ti 16 GB 3.38 ms 480x640, fp16
vs the faster original 2.6× original fp32: 8.64 ms
Peak memory 73 MiB original: 129 MiB
Accuracy vs original fp32 +0.48 portable acc, CALFW (cross-age LFW) (64.10 original)

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)

BackenddtypeTime per call (ms)vs original fp32Peak 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 normfp32 8.64–129 MiB/140 MiB1.60.45
Original fp16torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 normfp16 8.651.00×146 MiB/160 MiB0.30.02
Portable fp32fp32not measured ––––
Portablefp16 3.932.2×73 MiB/100 MiB0.20.24
Kernelsfp16 3.382.6×73 MiB/102 MiB0.30.15
Portable + torch.compile 2.054.2×105 MiB/120 MiB7 (build)–
TensorRT fp16fp16 0.37123×64 MiBenginenot comparable14 (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

DeviceBackenddtypems / callPeak memoryLoad / first call (s)Output vs referenceInput
Apple silicon runs on macOS
Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-30Portablefp165.74 281 MiB process0.2 / 0.1skip480x640
Portablefp326.44 516 MiB process0.8 / 0.1skip480x640

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
  • weights: LicenseRef-noncommercial

Our reading of the licences, not legal advice.

Weights

LVFace-T_Glint360K.pt 76.6 MB· hosted on Hugging Face

fastforks 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 %

Rundtypeacc ↑auc ↑Δ acc vs fp32 originalpairsms / pair
Original fp32fp3264.1069.63 reference 6000 7.73
Original fp16not measured
Portable fp32fp3264.6569.64 +0.55 6000 3.74
Portablefp1664.5869.64 +0.48 6000 3.54
Kernelsnot 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).

CheckToleranceMeasured
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_k and pairs find 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).

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
lvface-tsynthetic (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-ssynthetic (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-bsynthetic (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-lsynthetic (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-t 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); lvface-s 3000x4000 (0.6 GiB peak allocated, 0.6 reserved); lvface-b 3000x4000 (0.6 GiB peak allocated, 0.7 reserved); lvface-l 3000x4000 (0.9 GiB peak allocated, 0.9 reserved)
  • lvface-t 480x640, first call: portable + torch.compile 7 s (cold Inductor cache), TensorRT fp16 14 s (ONNX + engine).
  • lvface-s 480x640, first call: portable + torch.compile 7 s (cold Inductor cache), TensorRT fp16 15 s (ONNX + engine).
  • lvface-b 480x640, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 20 s (ONNX + engine).
  • lvface-l 480x640, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).
  • lvface-t original (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-t original 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-s original (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-s original 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-b original (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-b original 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-l original (fp32) 480x640: bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-l original 480x640: torch.autocast(float16) around the call; bytedance/LVFace@80bd20c8bb78 backbones.get_model, 112 x 112 resize, (x - 0.5) / 0.5, L2 norm
  • lvface-t load / first call: original 0.26 s / 0.021 s, portable 0.16 s / 0.241 s, kernels 0.33 s / 0.152 s
  • lvface-s load / first call: original 0.96 s / 0.012 s, portable 0.15 s / 0.008 s, kernels 0.54 s / 0.129 s
  • lvface-b load / first call: original 1.52 s / 0.02 s, portable 0.2 s / 0.007 s, kernels 0.7 s / 0.128 s
  • lvface-l load / 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.

variantdatasetoriginal fp32portableportable fp32note
lvface-tCALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC %64.10 / 69.6364.58 / 69.6464.65 / 69.64
lvface-sCALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC %69.47 / 75.7869.28 / 75.7869.45 / 75.78
lvface-bCALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC %78.17 / 84.9278.20 / 84.9278.15 / 84.92
lvface-lCALFW (cross-age LFW), 6000 official pairs, 10-fold verification accuracy / AUC %78.58 / 84.8278.58 / 84.8278.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).

variantkernels error vs original, mean / p99GPU, torchkernels used
lvface-t0.00013 / 0.00042RTX 5060 Ti, torch 2.14.1+cu130fvm_conv@f1d064e539e1:sm_120
lvface-s0.00018 / 0.00059RTX 5060 Ti, torch 2.14.1+cu130fvm_conv@f1d064e539e1:sm_120
lvface-b0.00013 / 0.00046RTX 5060 Ti, torch 2.14.1+cu130fvm_conv@f1d064e539e1:sm_120
lvface-l0.00011 / 0.00035RTX 5060 Ti, torch 2.14.1+cu130fvm_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.