Skip to main content

Professional YOLO training library with MLOps integration

Project description

wyolo: Professional YOLO MLOps Framework

Pylint Score Security: Bandit Python 3.8+ License: MIT

wyolo is a high-performance, enterprise-grade Python library designed to orchestrate the entire lifecycle of YOLO and RT-DETR models. By integrating native MLOps capabilities, wyolo transforms experimental computer vision into production-ready automated pipelines.


1. 🚶 Diagram Walkthrough

The following diagram illustrates the high-level execution flow from user request to model registration.

graph TD
    A[User/Worker Request] --> B{Configuration Loader}
    B --> C[Environment Validator]
    C -->|Success| D[GPU/Batch Optimizer]
    C -->|Failure| E[Error Capture & Notification]
    D --> F[Dataset Synchronization - DVC]
    F --> G[YOLO/RT-DETR Training Loop]
    G --> H[Metrics & Logs - MLflow]
    H --> I[Artifact Storage - MinIO/S3]
    I --> J[Model Registry]
    J --> K[Execution Completed]

2. 🗺️ System Workflow

Detailed sequence of events during a critical training operation, highlighting the interaction between core components.

sequenceDiagram
    participant U as User/Worker
    participant TW as TrainerWrapper
    participant MM as MLflowManager
    participant ULY as Ultralytics Engine
    participant S3 as MinIO Storage

    U->>TW: Initialize(config)
    TW->>MM: Setup Experiment & Run
    TW->>ULY: Start Training(hyperparameters)
    loop Every Epoch
        ULY-->>TW: Metrics Update
        TW->>MM: Log Metrics (mAP, Loss)
    end
    ULY-->>TW: Final Model (.pt)
    TW->>S3: Upload Artifacts
    TW->>MM: Register Model Version
    MM-->>U: Final Status & Registry Link

3. 🏗️ Architecture Components

Static structure and dependencies of the wyolo ecosystem.

mindmap
  root((wyolo System))
    Core Layer
      TrainerWrapper
      MLflowManager
      GPUUtils
    App Layer (Worker)
      State Machine
      Check States (GPU, Dataset)
      Train State
    External Integrations
      Ultralytics (YOLOv8, RT-DETR)
      MLflow (Tracking, Registry)
      DVC (Data Versioning)
      Redis (Messaging)
    Infrastructure
      Docker (Containerization)
      MinIO/S3 (Storage)

4. ⚙️ Container Lifecycle

a. Build Process

The construction of the production-ready artifact follows a multi-stage approach:

  1. Base Image Selection: Utilizes NVIDIA CUDA-enabled Python images for GPU acceleration.
  2. Dependency Resolution: Installation of system-level libraries (libgl1-mesa-glx) and project dependencies via pip.
  3. Code Injection: Surgical copying of the src/ directory and configuration templates.
  4. Environment Sanitization: Setting of non-root users and file permissions for secure execution.

b. Runtime Process

From instantiation to operational readiness:

  1. Entrypoint Execution: The container starts via train_service.sh.
  2. State Initialization: The main.py state machine loads the specific configuration.
  3. Resource Discovery: Automatic detection of CUDA devices and available VRAM.
  4. Data Mounting: CIFS/NFS mounts or DVC pulls to ensure dataset availability.
  5. Steady State: The worker enters the training loop, reporting heartbeats to Redis/MLflow.

5. 📂 File-by-File Guide

Path Purpose
src/wyolo/core/ Core logic for trainer wrappers, MLflow management, and GPU utilities.
src/wyolo/app/ Production worker implementation using a robust state-machine architecture.
src/wyolo/trainer/ Specialized model-type implementations and elemental DTOs.
src/wyolo/docker/ Orchestration scripts and requirements for containerized environments.
pyproject.toml Project metadata, build system configuration, and dependency locks.
Makefile Standardized automation for installation, testing, and documentation.
tests/ Comprehensive test suite ensuring behavioral and structural integrity.

🛠 Technical Stack

  • Engine: Ultralytics (YOLOv8, RT-DETR).
  • Tracking: MLflow.
  • Versioning: DVC.
  • Backend: Python 3.8+ with Loguru for logging.
  • Containerization: Docker with NVIDIA Container Toolkit.
  • Quality: Pytest, Pylint, Bandit.

🚀 Installation & Setup

Environment Preparation

# Clone the repository
git clone https://github.com/wisrovi/wyoloservice2_worker.git
cd wyoloservice2_worker

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate

Automation with Makefile

# Install all dependencies (including dev)
make install

# Run security and linting checks
make lint

# Execute test suite
make test

📈 Configuration & Usage

Configuration (YAML)

Create a config.yaml to define your experiment:

model: yolov8n.pt
type: detect
train:
  epochs: 100
  imgsz: 640
mlflow:
  uri: "http://your-mlflow-server"

Execution

# Run training via CLI
wyolo-train --config_path config.yaml --fitness map50

👨‍💻 Author

William Rodríguez - wisrovi
Technology Evangelist & AI Solutions Architect
LinkedIn Profile


📄 Bibliography & Source Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wyolo-1.0.0.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wyolo-1.0.0-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file wyolo-1.0.0.tar.gz.

File metadata

  • Download URL: wyolo-1.0.0.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for wyolo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bc71bb0b16d2785b0e69a50cabe8c8abaa37b064a0c95dd8ccb2ee2c5f204f99
MD5 596ab8e052b6b8f2d432735071dfa9ae
BLAKE2b-256 dab429fab3a5ac92494971d26276bfca82b1d9555f7fcc9203ac5a8863dcc766

See more details on using hashes here.

File details

Details for the file wyolo-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wyolo-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for wyolo-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9c98ae7823c1720a084ecf534669dcd123f3e3951b3a327ffdbd7249c6d6c81
MD5 a82c4d3077eb4d383f0b2c334fc8e04c
BLAKE2b-256 f025fd75d5ea4465d16e1058a3203f1b52a8b93b90d1b3c004c1b5f277d19579

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page