Skip to content

This project simply uses torchvision pretrained model to finetune and classify whether an image is anime or reality

Notifications You must be signed in to change notification settings

PD-Mera/anime-vs-reality-classification

Repository files navigation

Anime vs Reality Classification

This project simply classifies whether image is Anime or Reality

Environments

  • Python 3.10.9
  • torch 1.13.1
  • torchvision 0.14.1

Install requirements

pip install -r requirements.txt

Data

  • I get my data from various resource on internet. You can use your own data or crawl from internet.

  • Data in this format

|-- data
    |-- train
    |   |-- class 1
    |   |-- class 2
    |   `-- ...
    `-- valid
        |-- class 1
        |-- class 2
        `-- ...

Config

Modify config in ./cfg/config.yaml or create your own .yaml config file with the same format.

Train

Simply run

python train.py --cfg ./cfg/config.yaml

Experiment Results

Some experiment results

Model Accuracy Confusion Matrix Pretrained Model size
SqueezeNet1.1 99.34% CM1 Model 4.74MB
EfficientNet V2 Small 99.71% CM2 Model 82.74MB

You can download weight file above and put in weights folder and run inference

python infer.py

Some inference results

Anime Reality
Anime Reality

You can try on your own 😉

About

This project simply uses torchvision pretrained model to finetune and classify whether an image is anime or reality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages