https://github.com/freedomofkeima/moeflow
Repository for anime characters recognition website, powered by TensorFlow
https://github.com/freedomofkeima/moeflow
anime classification computer-vision python3 tensorflow transfer-learning
Last synced: 3 months ago
JSON representation
Repository for anime characters recognition website, powered by TensorFlow
- Host: GitHub
- URL: https://github.com/freedomofkeima/moeflow
- Owner: freedomofkeima
- License: mit
- Created: 2017-11-13T13:03:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-21T10:13:23.000Z (about 7 years ago)
- Last Synced: 2023-11-07T20:18:12.542Z (almost 2 years ago)
- Topics: anime, classification, computer-vision, python3, tensorflow, transfer-learning
- Language: Python
- Homepage:
- Size: 4.24 MB
- Stars: 119
- Watchers: 6
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MoeFlow
[](https://circleci.com/gh/freedomofkeima/MoeFlow/tree/master)
Repository for anime characters recognition website, powered by TensorFlow.
Demonstration page (Alpha version): [MoeFlow Website](https://freedomofkeima.com/moeflow/).
MoeFlow is featured in:
- PyCon ID 2017 | [Presentation](https://freedomofkeima.com/pyconid2017.pdf)
- [PyCon JP 2018](https://pycon.jp/2018/en/event/sessions) | [Presentation](https://freedomofkeima.com/pyconjp2018.pdf) | [Video](https://www.youtube.com/watch?v=Oh-raRnQoUA)## Project Introduction
This project is related to [freedomofkeima/transfer-learning-anime](https://github.com/freedomofkeima/transfer-learning-anime).
### Background
This project is heavily inspired from characters indexing website such as [saucenao](https://saucenao.com/) and [iqdb](https://www.iqdb.org/). In general, character indexing websites work well since character arts are generally limited in terms of number compared to real-life photos.
However, there are cases where character indexing websites will not work well, e.g.: the image is cropped or altered.
**Full Image** (Top: Saucenao, Bottom: MoeFlow)
**Altered Image**
Or, there are cases where you want to recognize a character from a photo.
(Top: Saucenao, Middle: iqdb, Bottom: MoeFlow)
### Transfer Learning
This project only uses [~~30~~* 60 images per character](100_class_traning_note.md) for learning, which are very low in number for image recognition learning. However, this number is chosen since the majority of characters has a limited number of arts.
In [yande.re](https://yande.re/tag?name=&order=count&type=4), there are around 35000 registered character tags. However, top 1000 characters only have 70+ images while top 2000 characters only have 40+ images.
(*) The number of dataset is increased from ~30 to ~60 and the overall accuracy is increased by 5% to 10% (from 60% - 65% to 70%).
## Requirements
- TensorFlow 1.4.0 (`pip install tensorflow==1.4.0` first)
- [nagadomi/animeface-2009](https://github.com/nagadomi/animeface-2009)## How to create initial environment
Python Environment:
```
$ virtualenv -p python3 venv # Ensure python3 version is 3.5, otherwise TensorFlow might not work
$ . venv/bin/activate
$ pip install tensorflow==1.4.0
```Since `nagadomi/animeface-2009` is an independent project, you need to clone it somewhere in your local directory. Note that the project requires Ruby, ImageMagick, and gcc to run.
After you finish installing it, go to `detect.rb` and update the `require` part (line 4) accordingly.
After that, you need to download MoeFlow model via `models/download_model.sh` (~ 100 MB).
## How to run
After running steps above, you can simply run it by:
```
$ export MOEFLOW_MODEL_PATH='/path/to/MoeFlow/models'
$ pip install -e .
$ app
```If your application is configured to run in a relative path, e.g.: [https://freedomofkeima.com/moeflow/](https://freedomofkeima.com/moeflow/), then you can set static URL path via `export MOEFLOW_RELATIVE_URL_PATH='/moeflow/'`.
## License
This project itself is licensed under MIT License.
Face recognition feature is developed by [nagadomi](https://github.com/nagadomi).
All images are owned by their respective creators.