Tip
The models and functionality in this repository are integrated into UniFace — an all-in-one face analysis toolkit.
PyTorch inference, ONNX export, and ONNX Runtime inference for eDifFIQA — a face image quality estimator that predicts a single quality score from an aligned 112×112 face. Uses UniFace for face detection and alignment.
| Variant | Backbone | Params | Input | PyTorch (.pth) | ONNX |
|---|---|---|---|---|---|
| eDifFIQA-T | MobileFaceNet | 1.7M | 112x112 | Link | Link |
| eDifFIQA-S | IResNet-18 | 24.6M | 112x112 | Link | Link |
| eDifFIQA-M | IResNet-50 | 44.1M | 112x112 | Link | Link |
| eDifFIQA-L | IResNet-100 | 65.7M | 112x112 | Link | Link |
Higher score = better quality. Authors evaluate against 10 FIQA competitors on 7 static-image datasets + 1 video dataset using EDC curves; LFW and XQLFW are the commonly cited references for high-quality vs. low-quality regimes. eDifFIQA-L ranks first on the NIST FATE-Quality Kiosk-to-Entry track. See the paper for per-dataset numbers.
.pthweights are ported from the upstream authors' OneDrive folder;.onnxfiles are exported from those weights and mirrored to this repo's release.
pip install -r requirements.txt
bash download.sheDifFIQA-T quality scores on assets/test_images/. The same face, progressively degraded, gets a sharply lower score:
| Original | Down-up sampled | Heavy blur |
|---|---|---|
![]() 0.762 |
![]() 0.435 |
![]() 0.144 |
![]() 0.737 |
![]() 0.537 |
![]() 0.273 |
Inputs are aligned 112×112 face crops. Pass a full image and alignment is handled for you; use --aligned or score_aligned() to skip it for already-aligned crops.
python main.py assets/test_images/image2.jpg --variant sPre-aligned 112×112 crops:
python main.py --aligned aligned_face.jpg --variant spython onnx_inference.py --model weights/ediffiqa_s.onnx assets/test_images/image2.jpgimport cv2
from models import eDifFIQAOnnx
from uniface.detection import SCRFD
detector = SCRFD()
quality = eDifFIQAOnnx("weights/ediffiqa_s.onnx")
image = cv2.imread("image.jpg")
for face in detector.detect(image):
score = quality.get_quality(image, face.landmarks)
print(f"Quality: {score:.4f}")python onnx_export.py -v s -w weights/ediffiqa_s.pth -o weights/ediffiqa_s.onnx --dynamic




