Using a pre-trained efficientnet (for experimental purposes
) to classifier plant diseases given an image.
The efficient net paper can be found here and the pretrained pytorch model got from torch hub
using torch.hub.list('rwightman/gen-efficientnet-pytorch')
For more cool PyTorch pre-trained models, check out Ross Wightman pytorch models repo
Download the dataset from the following link: https://www.crowdai.org/challenges/plantvillage-disease-classification-challenge
To set up your python environment to run the code in this repository, follow the instructions below.
- Create (and activate) a new environment with Python 3.6.
- Linux or Mac:
conda create --name py39 python=3.9.2 conda activate py39
alternatively, use virtual environments if you don't have Anaconda installed.
- Clone the repository (if you haven't already!), and navigate to the
anga
folder. Then, install several dependencies.
git clone https://github.com/mrdvince/anga
cd anga
A minimal API endpoint to expose your model, you can make it more robust if you want.
Run uvicorn api.main:app
and visit you local ip
if running locally port 8000
playground to access the interactive docs (included by default). i.e. http://127.0.0.1:8000/playground
See the README on this link has been(forked from). The readme contains information on the folder structures and how to modify the hyperparameters to your liking.
On a high level:
- the config json file contains the model hyperparamaters and other settings
Run python train.py -c config.json
to train the model.
Logged using tensorboard