To have a master codebase to train, infer and evaluate classifiers
This repo requires data in given format:-
- Image folder containing whole images that are to be used for training
- Train CSV that MUST have following columns:- a. image_name (CAN BE CHANGED BUT HAS TO BE UPDATED IN CONFIG FILE) b. xmin (MUST BE OF GIVEN NAME) c. ymin (MUST BE OF GIVEN NAME) d. xmax (MUST BE OF GIVEN NAME) e. ymax (MUST BE OF GIVEN NAME) f. class (MUST BE OF GIVEN NAME)
This repo is completely dependent on a config.yaml to train, allowing for dynamic hyperparameter tuning, without the need to change the original training code. However, if need arise we can easily add code to update architecture of our model. To get basic idea of how this repo works, you can refer to training_flow.jpg image.
After making sure your data is in above format you should do the following steps:-
- Create docker image with command->
sudo docker build -f dockerfile/Dockerfile -t classifier_image . - Create docker container using ->
sudo docker run -it --name cls_container -v ~/classifier:/classifier --gpus '"device=0,1,2,3"' -u $(id -u):$(id -g) --shm-size 160G classifier_image - You will be shown a new terminal, this is the terminal of docker container
- Now you can simply run
./autotrain.shand training process will start
Once container is created training process will start automatically. Make sure all data is already prepped before starting training
You can get last epoch trained model and best model from models/checkpoints/ folder