A Faster-RCNN based anime face detector.
This detector in trained on 6000 training samples and 641 testing samples, randomly selected from the dataset which is crawled from top 100 pixiv daily ranking.
Thanks to OpenCV based Anime face detector written by nagadomi, which helps labelling the data.
The original implementation of Faster-RCNN using Tensorflow can be found here
- Python 3.6.x
- tensorflow
- opencv-python
- cython
- Pre-trained ResNet101 model
- Clone this repository
git clone https://github.com/qhgz2013/anime-face-detector.git
- Download the pre-trained model
Google Drive: here
Baidu Netdisk: here - Unzip the model file into
model
directory - Build the CPU NMS model (skip this step if use PY_NMS with argument:
-nms-type PY_NMS
)make clean make
- Run the demo as you want
- Visualize the result (without output path):
python main.py -i /path/to/image.jpg
- Save results to a json file
Sample output file:
python main.py -i /path/to/image.jpg -o /path/to/output.json
{"/path/to/image.jpg": [{"score": 0.9999708, "bbox": [551.3375, 314.50253, 729.2599, 485.25674]}]}
- Detecting a whole directory with recursion
python main.py -i /path/to/dir -o /path/to/output.json
- Customize threshold
python main.py -i /path/to/image.jpg -nms 0.3 -conf 0.8
- Customize model path
python main.py -i /path/to/image.jpg -model /path/to/model.ckpt
- Customize nms type (supports CPU_NMS and PY_NMS, not supports GPU_NMS because of the complicated build process for Windows platform)
python main.py -i /path/to/image.jpg -nms-type PY_NMS
- Visualize the result (without output path):
Mean AP for this model: 0.9086
Copyright info: 【C94】桜と刀 by 幻像黒兎
Copyright info: アイドルマスター シンデレラガールズ by 我美蘭@1日目 東A-40a