Downloads · 30 days
55.9K
30% of all-time downloads
bytedance-research/LVFace
LVFace is a image feature extraction model from bytedance-research. Use it for the image feature extraction task on the model card, and read the license before you ship it in a product. It is set up for lvface. The card lists the license as mit.
<h2 align="center" <a href="https://arxiv.org/abs/2501.13420"[ICCV 2025 Highlight] LVFace: Progressive Cluster Optimization for Large Vision Models in Face Recognition</a</h2
Downloads · 30 days
55.9K
30% of all-time downloads
All-time downloads
186K
Public
Repo size
4.2 GB
Likes
35
Trending 1
Click a slice to open those files.
.onnx1.9 GB · 44%
From the Hugging Face model README
All required dependencies are listed in requirements.txt:
onnxruntime-gpu==1.19.2
torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
scikit-image
insightface
numpy==1.23
Install all dependencies with a single command: pip install -r requirements.txt
Test datasets for inference validation can be downloaded from the following sources:
Pretrained model weights for inference are available below in both ONNX and PyTorch (.pt) formats:
| Training Data | Model | IJB-C(1e-6) | IJB-C(1e-5) | IJB-C(1e-4) | IJB-B(1e-4) | Download |
|---|---|---|---|---|---|---|
| Glint360K | LVFace-T | 88.53 | 95.63 | 96.67 | 95.41 | HuggingFace |
| Glint360K | LVFace-S | 90.06 | 96.52 | 97.31 | 96.14 | HuggingFace |
| Glint360K | LVFace-B | 90.06 | 97.00 | 97.70 | 96.51 | HuggingFace |
| Glint360K | LVFace-L | 89.51 | 97.02 | 97.66 | 96.51 | HuggingFace |
| WebFace42M | LVFace-B | - | - | - | - | come soon |
1. Installation & Environment Setup
First, clone the repository and navigate to the project directory:
# Clone the LVFace repository
git clone https://github.com/bytedance/LVFace.git
# Enter the project directory
cd LVFace
Then install all required dependencies using the provided requirements.txt:
# Install dependencies
pip install -r requirements.txt
2. Download Pretrained Models
Download the ONNX-format pretrained weights from the LVFace Pretrained Models section, then place them in a directory (e.g., ./LVFace_model/).
3. Run Inference
Execute the inference_onnx.py script to perform feature extraction and similarity calculation. A complete workflow example:
## Initialize the inferencer from inference_onnx.py
inferencer = LVFaceONNXInferencer(
model_path="./models/vit_b_dp005_mask_005.onnx", # Path to your ONNX model
use_gpu=True # Set to False for CPU-only inference
)
## Extract feature from local image
feat1 = inferencer.infer_from_image("path/to/image1.jpg")
## Extract feature from URL
feat2 = inferencer.infer_from_url("https://example.com/image1.jpg")
## Calculate cosine similarity
similarity = inferencer.calculate_similarity(feat1, feat2)
print(f"Similarity score: {similarity:.6f}") # Output example: 0.892345
Note: The LVFaceONNXInferencer class is defined in inference_onnx.py, which handles ONNX model loading, image preprocessing, feature extraction, and similarity calculation in a unified interface. Ensure the model path and image paths are correctly specified before running.
Evaluation Steps
eval_ijbc.py).Evaluation Commands
python eval_ijbc.py \
--model-prefix path/to/LVFace-B_Glint360K.pt \
--result-dir results \
--network vit_b_dp005_mask_005 > LVFace-B_Glint360K.log 2>&1 &
The code of LVFace is released under the MIT License. There is no limitation for both academic and commercial usage. The models downloaded from our repo follow the above license policy (which is for non-commercial research purposes only).
If you find this work useful, please cite our paper and give us a star ⭐:
@inproceedings{you2025lvface,
title={{LVFace}: Progressive Cluster Optimization for Large Vision Models in Face Recognition},
author={You, Jinghan and Li, Shanglin and Sun, Yuanrui and Wei, Jiangchuan and Guo, Mingyu and Feng, Chao and Ran, Jiao},
booktitle={ICCV},
year={2025}
}
We sincerely thank Professor Jiankang Deng for his valuable guidance and insights throughout the research. We also appreciate the InsightFace for their excellent and research support.