Skip to content

igorastashov/mlops-example-project

Repository files navigation

MLops project

Code style: black Build Status

Pokemon image classification using Mobilenet_v2 model

Astashov I.V., 2023.

This repository contains model, evaluation code and training code on dataset from kaggle. If you would like to run pretrained model on your image see (2) Quick start.

(1) Setup

Install packages

  • This template use poetry to manage dependencies of your project. First you need to install poetry;
  • Next run poetry install and poetry shell.

(2) Quick start

Download model and optimizer

# Download model and optimizer
cd weights
bash download_weights.sh
cd ../..

Run on a single image

This command runs the model on a single image, and outputs the prediction. Put your Pokémon image into the appropriate folder photo to test.

# Model weights need to be downloaded
python inference.py

(3) Dataset

Download the dataset

A script for downloading the dataset is as follows:

# Download the dataset
cd data
bash download_data.sh
cd ../..

All the 150 Pokémon included in this dataset are from generation one. There are around 25 - 50 images for each Pokémon. All of them with the Pokémon in the center. Most (if not all) of the images have relatively high quality (correct labels, centered). The images don't have extremely high resolutions so it's perfect for some light deep learning.

If the script doesn't work, an alternative will be to download the zip files manually from the link. One can place the dataset zip files in data, respectively, and then unzip the zip file to set everything up.

PAY ATTENTION

This repository runs Data Version Control (DVC) for training and validation data. Pre-configured Google Drive remote storage stores raw input data.

$ dvc remote list
my_remote gdrive://1RXz3Mv7OxVveHtQ7c1ZtGgazDh6bPFJz

You can run dvc pull to download the data:

$ dvc pull

(4) Train and Evaluation model

Example script to train and evaluate model.

# Train ConvNet
python main.py

Hydra - hyperparameter management tool.

If you want to change hyper-parameters such as: epoch_count, lr, batch_size, momentum, then you can change them in the file conf/config.yaml.

(A) Acknowledgments

This repository borrows partially from Isadrtdinov, and FUlyankin repositories. Repository design taken from v-goncharenko, PeterWang512 and ArjanCodes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published