Steps for trainingΒΆ

This is a step by step guide to train the model, see steps for data versioning before this one.

  1. Unzip data using the command:

unzip data/data.zip
  1. Inside the Ultralytics folder, change it so runs are saved in the models folder of this repository.

cd /home/user/.config/Ultralytics

sudo vim settings.json

Do the following changes in settings.json:

"datasets_dir": "/home/user/your_path/repo-name",
"weights_dir": "/home/user/your_path/repo-name/models/weights",
"runs_dir": "/home/user/your_path/repo-name/models/runs",
  1. In the root folder of the repository, start Mlflow:

mlflow ui --backend-store-uri ./models/runs/mlflow

empty_mlfow

  1. In another terminal, train model:

cd src/

python3 train.py

This command will train the model and also save the best.onnx from the trained model inside the model S3 bucket. It will erase the file best.onnx from the bucket if it already exists. If you would like to use another YOLO model, you can run the following command (in the root of the repo):

python3 data/s3_bucket.py --file_path /absolute_train_path/weights/best.onnx
  1. Train again, changing hyperparameters if necessary.

mlflow_working

  1. All runs will be saved in the folder models/runs

mlflow_working_runs