/ml-ops-ucu

Primary LanguagePythonOtherNOASSERTION

ML Ops UCU Course Project. Visual Object Detection for Autonomous Driving

System design

System design doc link.

Video demonstration

Containerization video.

MLFlow+Minio in docker video.

Fine-tune YOLO 10

  1. Install YOLO10 - see Docker file for details.

  2. Train locally

    python scripts/run_training.py

Protobuf API

Install dependencies

pip install grpcio grpcio-tools

Generate

python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. services/object_detection_service.proto

Docker

Nvidia docker

sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

Build

docker build -t object-detection-service:v1.0 .  

Run bash

docker run -it --entrypoint /bin/bash object-detection-service:v1.0

Build && Run

Note: All parameters, they are important for correct running of the container! All paths shall be full.

docker build -t object-detection-service:v1.0 . && docker run --gpus all --ipc=host -p 50051:50051 -v $(pwd)/data:/app/data -v $(pwd)/data:/$(pwd)/data -it object-detection-service:v1.0

GRPC demo

python scripts/grpc_client.py

Experiment tracking

Summary

If secrets are already generated, build image and run with command

docker build -t object-detection-service:v1.0 . && docker-compose up -d
docker compose down

MLFlow address http://127.0.0.1:5000.

Setup

Minio

  • Run minio
  • Login to the console
  • Generate credentials
  • Save credentials to credentials.json.
docker pull minio/minio
docker volume create minio-data

To run independently (usually not needed because it is done in docker-compose):

docker run -d --name minio \
  -p 9000:9000 \
  -p 9001:9001 \
  -v minio-data:/data \
  -e "MINIO_ROOT_USER=minioadmin" \
  -e "MINIO_ROOT_PASSWORD=minioadmin" \
  minio/minio server /data --console-address ":9001"

You can now access the Minio server using the browser at (http://localhost:9000)[http://localhost:9000] and the Minio console at http://localhost:9001 using the credentials minioadmin for both the access key and secret key.

Generate docker compose environment file

./generate_env.sh

Docker compose

sudo curl -L "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version