This repository offers a production-ready deployment solution for YOLO8 Segmentation using TensorRT and ONNX. It aims to provide a comprehensive guide and toolkit for deploying the state-of-the-art (SOTA) YOLO8-seg model from Ultralytics, supporting both CPU and GPU environments. Our focus is to ensure seamless integration of AI models, specifically the cutting-edge YOLOv8, into Unitlab Annotate for enhanced object detection, instance segmentation, and other AI-driven tasks.
YOLOv8 represents the latest advancement in the YOLO series, developed by Ultralytics. It is a culmination of ongoing research and development, pushing the boundaries of speed, accuracy, and efficiency in object detection and segmentation. YOLOv8 is designed to excel in a wide range of tasks including object detection, tracking, instance segmentation, image classification, and pose estimation. For more details on YOLOv8, visit the official Ultralytics GitHub page: Ultralytics YOLOv8.
Unitlab is an AI-powered platform to manage, label, and visualize your data. Help your machine learning teams to automate the data annotation workflow. Bring your own pre-trained models to Unitlab Annotate and annotate your data 15 times faster. Get started right now.
After deploying the YOLOv8 model using this codebase and integrating it with Unitlab, you can easily visualize your model's results and compare the results of different models. Learn how to integrate AI models into Unitlab here.
- Fast and Efficient: Optimized production settings with TensorRT and ONNX, supporting both CPU and GPU options.
- Production-Ready: It requires just one line of command for production deployment.
- Integration with Unitlab Annotate: Demonstrates how to integrate your AI models with Unitlab Annotate for enhanced annotation capabilities. Follow up how to integrate it in https://docs.unitlab.ai/ai-models/model-integration
To get started with deploying YOLO8 Segmentation, follow the steps outlined below:
Ensure you have the following installed:
- Docker (for containerized deployment)
- Python 3.8 or higher
- Docker Compose (v2.20.2)
- TensorRT (for GPU acceleration)
- ONNX Runtime (for CPU deployment)
- Clone the Repository
Start by cloning this repository to your local system:
git clone https://github.com/teamunitlab/yolo8-segmentation-deploy.git
cd yolo8-segmentation-deploy
- Build & Run for CPU
Use Docker Compose to deploy for CPU environments:
docker-compose -f docker-compose-cpu.yml up -d --build
- Build & Run for GPU
For GPU acceleration, execute the following:
docker-compose -f docker-compose-gpu.yml up -d --build
- Local Testing
Test the deployment locally to ensure everything is working correctly:
# Using cURL
curl -X POST http://localhost:8080/api/yolo8/coco-segmentation \
-H "Content-Type: application/json" \
-d '{"src":"https://t3.ftcdn.net/jpg/02/43/12/34/360_F_243123463_zTooub557xEWABDLk0jJklDyLSGl2jrr.jpg"}'
# Using a Python Script
python service_test.py
MIT
- http://unitlab.ai/
- https://blog.unitlab.ai/yolov8-segmentation-deployment/
- https://docs.unitlab.ai/ai-models/model-integration
- https://blog.unitlab.ai/unitlab-streamlined-data-annotation-platform-for-computer-vision/
- https://github.com/ultralytics/ultralytics
- https://github.com/triple-Mu/YOLOv8-TensorRT