An object detector for character heads in animes, based on Yolo V3.
Yet another anime face/head detector, in addition to Faster RCNN and Viola Detector. The major difference is this one is more on character head instead of face only, so we also have outputs when the face is not visible. The algorithm is based on Yolo V3 and Pytorch implementation so it's good for high-speed processing and the usage is straight-forward.
Sample results:
We can detect correctly when a hat is present, but uncommon expression + decoration will fail the detection.
We can handle the case where the face is barely visible.
Although all our training data was labeled on a color anime set, the algorithm generalizes well on line drawings.
- First clone the repo using
git clone --recursive https://github.com/grapeot/AnimeHeadDetector
. Note the--recursive
switch. It's necessary because we usedgit submodule
to manage the dependency of PyTorch implementation. - Use
pip install -r requirements.txt
to install the dependencies. - And then download the pre-trained model using the
./downloadWeights.sh
script. (I just found my website cannot be accessed from within China. For China users, you can also download using this Baidu Pan link, with access codem88e
.) main.py
provides all necessary functionality.python main.py
should run out of box. It takes the images inimgs
, does detection, and visualizes the results indet
. Checkpython main.py --help
for detailed usage.
- You may want to tweak the
CONFIDENCE_THRESHOLD
inAnimeHeadDetector.py
for the desired detection precision/recall. - The training data is merely 200 images from two animes. The algorithm works surprisingly well.