docker.recipes

Computer Vision Pipeline

advanced

CV pipeline with Label Studio for annotation, MinIO storage, and Triton inference server

Overview

Label Studio is an open-source data labeling platform developed by Heartex that provides a web-based interface for annotating various types of data including images, text, audio, and video. Originally created to address the bottleneck of manual data annotation in machine learning workflows, Label Studio supports over 60 different labeling templates and can handle complex annotation tasks like object detection, semantic segmentation, and multi-class classification with customizable labeling interfaces. This computer vision pipeline combines Label Studio's annotation capabilities with MinIO's S3-compatible object storage for scalable data management and NVIDIA Triton Inference Server for high-performance model serving. The stack creates a complete MLOps workflow where raw images are stored in MinIO buckets, annotated through Label Studio's web interface, and the resulting trained models are deployed via Triton for real-time inference. PostgreSQL handles Label Studio's metadata, user management, and annotation storage, ensuring data integrity throughout the annotation process. This configuration is ideal for computer vision teams, AI startups, and research organizations that need to process large volumes of visual data while maintaining control over their annotation pipeline and model deployment infrastructure. The combination provides enterprise-grade performance and scalability without the vendor lock-in of cloud-based annotation services, making it particularly valuable for organizations with strict data governance requirements or those working with sensitive visual data.

Key Features

  • Label Studio's flexible annotation interface with support for bounding boxes, polygons, keypoints, and semantic segmentation for computer vision tasks
  • MinIO S3-compatible storage with erasure coding and encryption for secure management of large image datasets and model artifacts
  • NVIDIA Triton Inference Server with GPU acceleration supporting TensorRT, PyTorch, TensorFlow, and ONNX model formats
  • PostgreSQL backend for Label Studio providing ACID compliance for annotation data and support for complex queries on labeling statistics
  • Label Studio's export functionality generating annotations in COCO, YOLO, Pascal VOC, and other popular computer vision formats
  • Triton's dynamic batching and model versioning capabilities for A/B testing different computer vision model iterations
  • MinIO's bucket lifecycle policies for automated data archival and cost optimization of training datasets
  • Label Studio's collaborative annotation features with user roles, task assignment, and annotation quality control workflows

Common Use Cases

  • 1Autonomous vehicle companies building training datasets for object detection and semantic segmentation models
  • 2Medical imaging organizations annotating radiological scans, pathology slides, and diagnostic images for AI-assisted diagnosis
  • 3Retail and e-commerce platforms creating product image classification and visual search training data
  • 4Security and surveillance companies developing person detection, behavior analysis, and anomaly detection systems
  • 5Manufacturing quality control teams training computer vision models for defect detection and automated inspection
  • 6Agricultural technology companies building crop monitoring and disease detection models from drone and satellite imagery
  • 7Sports analytics organizations annotating player movements, ball tracking, and game event detection in video footage

Prerequisites

  • NVIDIA GPU with CUDA support and nvidia-docker runtime installed for Triton inference server acceleration
  • Minimum 8GB RAM recommended (2GB for MinIO, 1GB for PostgreSQL, 2GB for Label Studio, 3GB+ for Triton with models)
  • Docker Compose version 3.8+ with GPU support and familiarity with NVIDIA Container Toolkit configuration
  • Understanding of computer vision model formats (ONNX, TensorRT, PyTorch) and Triton model repository structure
  • Basic knowledge of S3 API and MinIO bucket policies for managing training data and model artifact storage
  • Familiarity with Label Studio's labeling templates and annotation export formats for computer vision workflows

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 label-studio:
3 image: heartexlabs/label-studio:latest
4 container_name: label-studio
5 restart: unless-stopped
6 ports:
7 - "${LABEL_STUDIO_PORT:-8080}:8080"
8 environment:
9 - DJANGO_DB=default
10 - POSTGRE_NAME=labelstudio
11 - POSTGRE_USER=labelstudio
12 - POSTGRE_PASSWORD=${DB_PASSWORD}
13 - POSTGRE_HOST=label-studio-db
14 - POSTGRE_PORT=5432
15 - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
16 - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/files
17 volumes:
18 - label_studio_data:/label-studio/data
19 - ./files:/label-studio/files
20 depends_on:
21 - label-studio-db
22
23 label-studio-db:
24 image: postgres:15-alpine
25 container_name: label-studio-db
26 restart: unless-stopped
27 environment:
28 - POSTGRES_USER=labelstudio
29 - POSTGRES_PASSWORD=${DB_PASSWORD}
30 - POSTGRES_DB=labelstudio
31 volumes:
32 - label_studio_db_data:/var/lib/postgresql/data
33
34 minio:
35 image: minio/minio:latest
36 container_name: cv-minio
37 restart: unless-stopped
38 ports:
39 - "${MINIO_PORT:-9000}:9000"
40 - "${MINIO_CONSOLE:-9001}:9001"
41 environment:
42 - MINIO_ROOT_USER=${MINIO_ACCESS_KEY}
43 - MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY}
44 volumes:
45 - minio_data:/data
46 command: server /data --console-address ":9001"
47
48 triton:
49 image: nvcr.io/nvidia/tritonserver:latest
50 container_name: triton
51 restart: unless-stopped
52 ports:
53 - "${TRITON_HTTP:-8000}:8000"
54 - "${TRITON_GRPC:-8001}:8001"
55 - "${TRITON_METRICS:-8002}:8002"
56 volumes:
57 - ./models:/models
58 command: tritonserver --model-repository=/models
59 deploy:
60 resources:
61 reservations:
62 devices:
63 - driver: nvidia
64 count: all
65 capabilities: [gpu]
66
67volumes:
68 label_studio_data:
69 label_studio_db_data:
70 minio_data:

.env Template

.env
1# Computer Vision Pipeline
2LABEL_STUDIO_PORT=8080
3MINIO_PORT=9000
4MINIO_CONSOLE=9001
5TRITON_HTTP=8000
6TRITON_GRPC=8001
7TRITON_METRICS=8002
8
9# Database
10DB_PASSWORD=labelstudio_password
11
12# MinIO
13MINIO_ACCESS_KEY=minioadmin
14MINIO_SECRET_KEY=minioadmin

Usage Notes

  1. 1Label Studio at http://localhost:8080 (create account)
  2. 2MinIO Console at http://localhost:9001
  3. 3Triton inference at localhost:8000 (HTTP), 8001 (gRPC)
  4. 4Place models in ./models with Triton config.pbtxt
  5. 5Label Studio exports annotations for training
  6. 6Triton serves trained models for inference

Individual Services(4 services)

Copy individual services to mix and match with your existing compose files.

label-studio
label-studio:
  image: heartexlabs/label-studio:latest
  container_name: label-studio
  restart: unless-stopped
  ports:
    - ${LABEL_STUDIO_PORT:-8080}:8080
  environment:
    - DJANGO_DB=default
    - POSTGRE_NAME=labelstudio
    - POSTGRE_USER=labelstudio
    - POSTGRE_PASSWORD=${DB_PASSWORD}
    - POSTGRE_HOST=label-studio-db
    - POSTGRE_PORT=5432
    - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
    - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/files
  volumes:
    - label_studio_data:/label-studio/data
    - ./files:/label-studio/files
  depends_on:
    - label-studio-db
label-studio-db
label-studio-db:
  image: postgres:15-alpine
  container_name: label-studio-db
  restart: unless-stopped
  environment:
    - POSTGRES_USER=labelstudio
    - POSTGRES_PASSWORD=${DB_PASSWORD}
    - POSTGRES_DB=labelstudio
  volumes:
    - label_studio_db_data:/var/lib/postgresql/data
minio
minio:
  image: minio/minio:latest
  container_name: cv-minio
  restart: unless-stopped
  ports:
    - ${MINIO_PORT:-9000}:9000
    - ${MINIO_CONSOLE:-9001}:9001
  environment:
    - MINIO_ROOT_USER=${MINIO_ACCESS_KEY}
    - MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY}
  volumes:
    - minio_data:/data
  command: server /data --console-address ":9001"
triton
triton:
  image: nvcr.io/nvidia/tritonserver:latest
  container_name: triton
  restart: unless-stopped
  ports:
    - ${TRITON_HTTP:-8000}:8000
    - ${TRITON_GRPC:-8001}:8001
    - ${TRITON_METRICS:-8002}:8002
  volumes:
    - ./models:/models
  command: tritonserver --model-repository=/models
  deploy:
    resources:
      reservations:
        devices:
          - driver: nvidia
            count: all
            capabilities:
              - gpu

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 label-studio:
5 image: heartexlabs/label-studio:latest
6 container_name: label-studio
7 restart: unless-stopped
8 ports:
9 - "${LABEL_STUDIO_PORT:-8080}:8080"
10 environment:
11 - DJANGO_DB=default
12 - POSTGRE_NAME=labelstudio
13 - POSTGRE_USER=labelstudio
14 - POSTGRE_PASSWORD=${DB_PASSWORD}
15 - POSTGRE_HOST=label-studio-db
16 - POSTGRE_PORT=5432
17 - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
18 - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/files
19 volumes:
20 - label_studio_data:/label-studio/data
21 - ./files:/label-studio/files
22 depends_on:
23 - label-studio-db
24
25 label-studio-db:
26 image: postgres:15-alpine
27 container_name: label-studio-db
28 restart: unless-stopped
29 environment:
30 - POSTGRES_USER=labelstudio
31 - POSTGRES_PASSWORD=${DB_PASSWORD}
32 - POSTGRES_DB=labelstudio
33 volumes:
34 - label_studio_db_data:/var/lib/postgresql/data
35
36 minio:
37 image: minio/minio:latest
38 container_name: cv-minio
39 restart: unless-stopped
40 ports:
41 - "${MINIO_PORT:-9000}:9000"
42 - "${MINIO_CONSOLE:-9001}:9001"
43 environment:
44 - MINIO_ROOT_USER=${MINIO_ACCESS_KEY}
45 - MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY}
46 volumes:
47 - minio_data:/data
48 command: server /data --console-address ":9001"
49
50 triton:
51 image: nvcr.io/nvidia/tritonserver:latest
52 container_name: triton
53 restart: unless-stopped
54 ports:
55 - "${TRITON_HTTP:-8000}:8000"
56 - "${TRITON_GRPC:-8001}:8001"
57 - "${TRITON_METRICS:-8002}:8002"
58 volumes:
59 - ./models:/models
60 command: tritonserver --model-repository=/models
61 deploy:
62 resources:
63 reservations:
64 devices:
65 - driver: nvidia
66 count: all
67 capabilities: [gpu]
68
69volumes:
70 label_studio_data:
71 label_studio_db_data:
72 minio_data:
73EOF
74
75# 2. Create the .env file
76cat > .env << 'EOF'
77# Computer Vision Pipeline
78LABEL_STUDIO_PORT=8080
79MINIO_PORT=9000
80MINIO_CONSOLE=9001
81TRITON_HTTP=8000
82TRITON_GRPC=8001
83TRITON_METRICS=8002
84
85# Database
86DB_PASSWORD=labelstudio_password
87
88# MinIO
89MINIO_ACCESS_KEY=minioadmin
90MINIO_SECRET_KEY=minioadmin
91EOF
92
93# 3. Start the services
94docker compose up -d
95
96# 4. View logs
97docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/computer-vision-pipeline/run | bash

Troubleshooting

  • Label Studio 'Database connection failed' error: Ensure PostgreSQL container is fully started before Label Studio by adding health checks or increasing startup delay
  • Triton 'No models available' message: Verify model repository structure with config.pbtxt files and correct model format in ./models directory
  • MinIO 'Access Denied' errors: Check MINIO_ACCESS_KEY and MINIO_SECRET_KEY environment variables match client configuration and bucket policies
  • Label Studio annotation exports timing out: Increase Django timeout settings and ensure sufficient disk space in label_studio_data volume
  • Triton GPU memory errors: Monitor nvidia-smi output and adjust model instance counts or batch sizes in model configuration files
  • PostgreSQL connection pool exhaustion: Increase max_connections in PostgreSQL configuration or implement connection pooling for high-volume annotation workloads

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space