This repository contains an extremely user-friendly image classification model that uses PyTorch Lightning and Hydra. It uses Chest X-Ray images but theoretically it can be implemented for any image dataset.
Install dependencies
# clone project
git clone https://github.com/fpozoc/cxr-img-classifier.git
cd cxr-img-classifier
# [OPTIONAL] create conda environment
conda create -n cxr-img-classifier python=3.8
conda activate cxr-img-classifier
# install pytorch according to instructions
# https://pytorch.org/get-started/
# install requirements
pip install -r requirements.txt
Train model with default configuration
# train on CPU
python train.py trainer.gpus=0
# train on GPU
python train.py trainer.gpus=1
Train model with chosen experiment configuration from configs/experiment/
python train.py experiment=experiment_name.yaml
You can override any parameter from command line like this
python train.py trainer.max_epochs=20 datamodule.batch_size=64