https://github.com/clibdev/ultra-light-fast-generic-face-detector-1mb
💎1MB lightweight face detection model
https://github.com/clibdev/ultra-light-fast-generic-face-detector-1mb
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
â—‹CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
â—‹.zenodo.json file
-
â—‹DOI references
-
â—‹Academic publication links
-
â—‹Academic email domains
-
â—‹Institutional organization owner
-
â—‹JOSS paper metadata
-
â—‹Scientific vocabulary similarity
Low similarity (6.1%) to scientific vocabulary
Repository
💎1MB lightweight face detection model
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Fork of Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB
Differences between original repository and fork:
- Compatibility with PyTorch >=2.4. (🔥)
- Original pretrained models and converted ONNX models from GitHub releases page. (🔥)
- Sample script detect_img.py for inference of single image.
- Added command line arguments to converttoonnx.py.
- The following deprecations and errors has been fixed:
- DeprecationWarning: 'np.float' is a deprecated alias for builtin 'float'.
- FutureWarning: You are using 'torch.load' with 'weights_only=False'.
- FutureWarning: Cython directive 'language_level' not set.
- Cython Warning: Using deprecated NumPy API.
- cv2.error: Can't parse 'xx'. Sequence item with index 0 has a wrong type.
- cv2.error: Can't parse 'xx'. Expected sequence length 4, got 2.
Installation
shell
pip install -r requirements.txt
Pretrained models
- Download links:
| Name | Model Size (MB) | Link | SHA-256 |
|--------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| UltraFace-slim-320 | 1.0
1.1 | PyTorch
ONNX | cd24abce45da5dbc7cfd8167cd3d5f955382dfc9d9ae9459f0026abd3c2e38a4
3a85d818ae391c030694f12558d3b2edf3e47b4bc0916fa5a2f5330867a98cb7 |
| UltraFace-RFB-320 | 1.1
1.2 | PyTorch
ONNX | c722b4427cc71642768baef6e15c659931b56f07425e5d2b0ec033ad41b145b3
8611231d4e6c1f3cda9eb5365518ab1c230df71090c11ed8e701b6ab9b7c58bd |
| UltraFace-slim-640 | 1.0
1.4 | PyTorch
ONNX | 02ca778098127c46d2b2680f1c398c7b993c12a424e94c34e6d608beb73481e4
5380b75201e135e4b2c42a5ae4b127e8e474b30f82dfcf8c0cacb254bbf5f243 |
| UltraFace-RFB-640 | 1.1
1.5 | PyTorch
ONNX | bf34512b1a93dc234178e8a701ecf25c6afddf335a3226accf62982536e160b5
a3d2fa1ccd444f244716d96fcf0d32d454e422cb8163faa840f80968e25d6f77 |
- Evaluation results on WIDERFace dataset:
| Name | Image Size
(pixels) | Easy | Medium | Hard |
|--------------------|------------------------|-------|--------|-------|
| UltraFace-slim-320 | 320 x 240 | 0.770 | 0.671 | 0.395 |
| UltraFace-RFB-320 | 320 x 240 | 0.787 | 0.698 | 0.438 |
| UltraFace-slim-640 | 640 x 480 | 0.853 | 0.819 | 0.539 |
| UltraFace-RFB-640 | 640 x 480 | 0.855 | 0.822 | 0.579 |
Inference
shell
python detect_img.py --net_type RFB --path imgs/1.jpg
WIDERFace evaluation
- Download WIDERFace validation dataset.
- Move dataset to
data/widerface/valdirectory.
shell
cd widerface_evaluate
shell
python evaluation_on_widerface.py
shell
python setup.py build_ext --inplace
shell
python evaluation.py
Export to ONNX format
shell
pip install onnx
shell
python convert_to_onnx.py --model_path models/pretrained/version-slim-320.pth --net_type slim --input_size 320
python convert_to_onnx.py --model_path models/pretrained/version-slim-640.pth --net_type slim --input_size 640
python convert_to_onnx.py --model_path models/pretrained/version-RFB-320.pth --net_type RFB --input_size 320
python convert_to_onnx.py --model_path models/pretrained/version-RFB-640.pth --net_type RFB --input_size 640
Owner
- Login: clibdev
- Kind: user
- Repositories: 1
- Profile: https://github.com/clibdev
GitHub Events
Total
Last Year
Dependencies
- Cython >=3.0.0
- opencv-python >=4.10.0
- scipy >=1.14.0
- torch >=2.4.0
- torchvision >=0.19.0
- tqdm >=4.66.0