Simple straightfoward repo for simple task of image classsification. Uses yaml config files to set hyperparameters for training. And loads data through list-style datasets. Training logs are written to console and also to tensorboard.
Each dataset (train/val/test) is defined in csv files:
<path to image>,<class name>
...
...
...
<path to image>,<class name>
Accompanied by class names in classes.txt
classA
classB
...
classZ
- Copy
configs/config-example.yaml
and modify accordingly. python3 train.py --config <path to config>
- Copy
configs/config-example.yaml
and modify accordingly. Make sure pointing to the right path of the trained weights. python3 test.py --config <path to config>
- Copy
configs/config-infer-example.yaml
and modify accordingly. Make sure pointing to the right path of the trained weights. python3 infer.py --config <path to config>
- Look at the example under the
if __name__=='__main__'
portion ofinfer.py
and adapt to your own application accordingly. Main thing is instantiating theClassifier
object with your config yaml file and running itspredict
method.
- Augmentations/preprocessing transformations are defined in their own
.yaml
files, supports torchvision.transforms.