Giter Club home page Giter Club logo

gottaclassifyemall's Introduction

GottaClassifyEmAll

Python version Hugging Face

This repository contains a script to fine-tune a transformer encoder model for Pokemon images classification. The model is based on Vision Transformer (VIT) and has been fine-tuned on 1st Generation Pokemon images.

The final model is able to discriminate between the pokemons from the 1st Generation. And tell when the provided images are not pokemons, or at least when it is unable to recognize them (e.g. pokemons from posterior generations).

Feel free to try it out on my demo hosted on Spaces!

Usage

Setup

  1. Clone this repository:

    git clone https://github.com/A-Duss/GottaClassifyEmAll.git
    cd GottaClassifyEmAll
  2. Install the required packages:

    pip install -r requirements.txt

Use the already fine-tuned model

You can use my fine-tuned model hosted on Hugging Face Model Hub: Dusduo/Pokemon-classification-1stGen, by running the predict.py as in the following code:

python predict.py --img_path=./data/sample_imgs/01abra.jpg --load_from_hf

Change the --img_path value to correspond to the path of the image you want to classify.

Fine-tune the model yourself:

Fine-tune the model by running the train.py script.

python train.py

After fine-tuning, the model can be used to classify images by running predict.py in the following fashion:

python predict.py --img_path=./data/sample_imgs/01abra.jpg

Change the --img_path value to correspond to the path of the image you want to classify.

Pre-trained Model

Fine-Tuning Dataset

Model

You can find my final fine-tuned model on Hugging Face Model Hub: Dusduo/Pokemon-classification-1stGen

It achieves the following results on the evaluation set:

  • Loss: 0.4182
  • F1: 0.9272

Don't forget to try out my demo hosted on Spaces!

gottaclassifyemall's People

Contributors

a-duss avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.