--- title: LS YOLO Backend emoji: 🎯 colorFrom: yellow colorTo: red sdk: docker app_port: 9090 pinned: false license: apache-2.0 short_description: YOLO as a Label Studio ML backend --- # LS YOLO Backend (Hugging Face Spaces) This Space wraps HumanSignal's [`yolo` ML backend example](https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/yolo) as a Hugging Face Space, so it can be used as a `/predict` backend for a Label Studio instance. **Patches from the upstream example (minimal):** - Added Spaces SDK frontmatter at the top of this README. - Removed `docker-compose.yml` (not used on Spaces). The Dockerfile already binds to `$PORT` and listens on `0.0.0.0`, so it deploys as-is. Hardware: `t4-small` (GPU recommended for YOLO inference). Connect from Label Studio: set the ML backend URL to `https://davanstrien-ls-yolo-backend.hf.space`. --- # YOLO ML backend for Label Studio The YOLO ML backend for Label Studio is designed to integrate advanced object detection, segmentation, classification, and video object tracking capabilities directly into Label Studio. This integration allows you to leverage powerful YOLOv8 models for various machine learning tasks, making it easier to annotate large datasets and ensure high-quality predictions.
YOLO Integration Video
Check the video tutorial

## Table of Contents 1. [YOLO ML backend for Label Studio](#yolo-ml-backend-for-label-studio) 1. [Supported Features](#supported-features) 1. [Before you begin](#before-you-begin) 1. [Quick start](#quick-start) 1. [Labeling configurations](#labeling-configurations) 1. [Supported YOLO Versions: YOLOv5, YOLO11, and others](#supported-yolo-versions-yolov5-yolo11-and-others) 1. [Your own custom YOLO models](#your-own-custom-yolo-models) 1. [Training](#training) 1. [Classification using ``](#classification-using-choices) 1. [Object detection using `RectangleLabels`](#object-detection-using-rectanglelabels) 1. [Segmentation using `PolygonLabels`](#segmentation-using-polygonlabels) 1. [Keypoint detection using `KeyPointLabels`](#keypoint-detection-using-keypointlabels) 1. [Video object tracking using `VideoRectangle`](#video-object-tracking-using-videorectangle) 1. [Video temporal classification using `TimelineLabels`](#video-temporal-classification-using-timelinelabels) 1. [Run the YOLO ML backend](#run-the-yolo-ml-backend) 1. [Running with Docker (recommended)](#running-with-docker-recommended) 1. [Building from source (advanced)](#building-from-source-advanced) 1. [Running without Docker (advanced)](#running-without-docker-advanced) 1. [Parameters](#parameters) 1. [Command line interface for the terminal](#command-line-interface-for-the-terminal) 1. [For developers](#for-developers) For a more detailed table of contents, you can use GitHub's native menu located at the top-right corner . ## Supported Features | YOLO Task Name | LS Control Tag | Prediction Supported | LS Import Supported | LS Export Supported | |--------------------------------------------------------------|--------------------------------------|----------------------|---------------------|---------------------| | Object Detection | `` | βœ… | YOLO, COCO | YOLO, COCO | | Oriented Bounding Boxes (OBB) | `` | βœ… | YOLO | YOLO | | Image Instance Segmentation: Polygons | `` | βœ… | COCO | YOLO, COCO | | Image Semantic Segmentation: Masks | `` | ❌ | Native | COCO (as polygons) | | Image Classification | `` | βœ… | Native | Native | | Pose Detection | `` | βœ… | Native | YOLO, COCO | | Video Object Tracking | `` | βœ… | Native | Native | | [Video Temporal Classification](./README_TIMELINE_LABELS.md) | `` | βœ… | Native | Native | * **LS Control Tag**: Label Studio [control tag](https://labelstud.io/tags/) from the labeling configuration. * **LS Import Supported**: Indicates whether Label Studio supports Import from YOLO format to Label Studio (using the LS converter). * **LS Export Supported**: Indicates whether Label Studio supports Export from Label Studio to YOLO format (the **Export** button on the Data Manager and using the LS converter). * **Native**: Native means that only native Label Studio JSON format is supported. ## Before you begin Before you begin, you need to install the [Label Studio ML backend](https://github.com/HumanSignal/label-studio-ml-backend?tab=readme-ov-file#quickstart). This tutorial uses the [YOLO example](https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/yolo). ## Quick start 1. Add `LABEL_STUDIO_URL` and `LABEL_STUDIO_API_KEY` to the `docker-compose.yml` file. These variables should point to your Label Studio instance and its API key, respectively. For more information about finding your Label Studio API key, [see our documentation](https://labelstud.io/guide/user_account#Access-token). 2. Run docker compose ```bash docker-compose up --build ``` 3. Open Label Studio and create a new project with the following labeling config: ```xml ``` 4. Then from the **Model** page in the project settings, [connect the model](https://labelstud.io/guide/ml#Connect-the-model-to-Label-Studio). The default URL is `http://localhost:9090`. 5. Add images or video (depending on tasks you are going to solve) to Label Studio. 6. Open any task in the Data Manager and see the predictions from the YOLO model. ## Labeling configurations ### Supported object & control tags **Object tags** - `` - [Image to annotate](https://labelstud.io/tags/image) - `