A Streamlit-based Touhou Project character classifier built on PyTorch. The app includes Grad-CAM visualizations to explain model predictions and an in-app Pixiv crawler to help you collect and curate training data.
Want to use the classifier without setting up a development environment?
- Download and extract the zip file
- Double-click
start_classifier.bat - If
uvis not installed, it will be installed automatically - Wait for dependencies to install (first run only)
- A browser window will open with the classifier
🩵Supported Characters (21 total)
- Alice アリス・マーガトロイド
- Cirno 琪露诺
- Flandre 芙兰朵露
- Inubashiri 犬走椛
- Kaguya 蓬莱山輝夜
- Kochiya 東風谷早苗
- Koishi 古明地恋
- Kokoro 秦こころ
- Konpaku 魂魄妖夢
- Marisa 霧雨魔理沙
- Meiling 紅美鈴
- Miku 初音ミク
- Mokou 藤原妹紅
- Reimu 博麗霊夢
- Reisen 鈴仙・優曇華院・イナバ
- Remilia 蕾米莉亚
- Sakuya 十六夜咲夜
- Satori 古明地さとり
- Shameimaru 射命丸文
- Suika 伊吹萃香
- Yuyuko 西行寺幽々子
- Grad-CAM visual explanations
- Generates heatmaps and overlays them on the input image
- Clarifies why a character was predicted
- Pixiv crawler inside Streamlit
- Search by keyword or tag
- Filter by illustration type and options
- Sort results to keep dataset collection organized
- Browser-based Pixiv refresh token flow
- Obtain your Pixiv refresh token headlessly by providing your credentials in the .env file
- Sample dataset: https://drive.google.com/drive/folders/1g0fvx9OwYUaohgFOwiKB1FCoqBD72DZA?usp=sharing
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/YYDongRo/TouhouCharClassifier.gitFeel free to use other images source
PIXIV_USERNAME=""
PIXIV_PASSWORD=""uv run streamlit run app.pyOrganize your images as one folder per class:
data/
reimu/
marisa/
cirno/Train the model using:
uv run python -m src.train