Repository
yolov7-face-blur
This repository is created on top of two repositories i.e., yolov7 face detection and yolov7 blurring object
README
<img src="https://img.shields.io/badge/license-MIT-blue.svg">
yolov7-face-blur
This repository is created on top of two repository
How to install
- Create Virutal Environment of Python, Recommended python version
3.9.0, incase you dont have3.9.0, seepyenvguide. - Activate the Environment using
python -m venv your_env_name/Scripts/activate - install required libraries using
pip install -r requirements - (Optional) If you want to use GPU, you have to install additional requirements i.e,
pip install -r requirements_gpu.txt
Models:
| Models | Test Size | Easy | Medium | Hard | FLOPs (B) @640 | Baidu | |
|---|---|---|---|---|---|---|---|
| yolov7-lite-t | 640 | 88.7 | 85.2 | 71.5 | 0.8 | gsmn | |
| yolov7-lite-s | 640 | 92.7 | 89.9 | 78.5 | 3.0 | 3sp4 | |
| yolov7-tiny | 640 | 94.7 | 92.6 | 82.1 | 13.2 | aujs | |
| yolov7s | 640 | 94.8 | 93.1 | 85.2 | 16.8 | w72z | |
| yolov7 | 640 | 96.9 | 95.5 | 88.0 | 103.4 | jrj6 | |
| yolov7+TTA | 640 | 97.2 | 95.8 | 87.7 | 103.4 | jrj6 | |
| yolov7-w6 | 960 | 96.4 | 95.0 | 88.3 | 89.0 | - | |
| yolov7-w6+TTA | 1280 | 96.9 | 95.8 | 90.4 | 89.0 | - |
Required Arguments to run
--weightscontains your downloaded model from the above table--bluurratioto determine the strength of blurring, default value is20--deviceeithercpuor0in case ofgpu.--sourcecontaines your images (png, jpg etc) or video (mp4 etc)
Examples
# Example with detected accuracy (usng CPU)
python detect.py --weights yolov7-tiny.pt --blurratio 50 --device cpu --source myimage.jpg
# Example with hiding detected area, only blur (usng CPU)
python detect.py --weights yolov7-tiny.pt --blurratio 50 --hidedetarea --device cpu --source myimage.jpg
# Example on video (usng CPU)
python detect.py --weights yolov7-tiny.pt --blurratio 50 --hidedetarea --device cpu --source myvideo.mp4
