This backend provides ML-assisted labeling capabilities to accelerate your annotation workflow, supporting both object detection and instance segmentation tasks.
-
Dockerfile: The Dockerfile for building the backend container.
-
docker-compose.yml: The docker-compose file for running the backend.
-
_wsgi.py: WSGI app initializer.
-
start.sh: bash script to start the whole process.
-
model.py: The Python code for the ML backend model.
-
requirements.txt: The list of Python dependencies for the backend.
-
Clone the repository:
git clone https://github.com/seblful/label-studio-yolo-backend.git cd label-studio-yolo-backend
-
Create and prepare your model directory:
mkdir model cp /path/to/your/model.pt model/ mv model/your_model.pt model/best.pt
-
Edit
.env
with your settings:- LABEL_STUDIO_URL=http://host.docker.internal:${PORT} - LABEL_STUDIO_API_KEY=<your_api_key> - TASK_TYPE=<detection> or <segmentation>
Important Notes:
- Default LABEL_STUDIO_URL is
http://host.docker.internal:8080
- Get IP using 'ifconfig' (Linux/Mac) or 'ipconfig' (Windows)
⚠️ Never uselocalhost
as the container is isolated from the host- Get your API_KEY from: Label Studio -> Account Settings -> Access Token
- Default LABEL_STUDIO_URL is
-
Deploy using the following commands:
docker pull pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime docker compose build docker compose up
-
Add model in project settings:
From the project settings, select the Model page and click Connect Model.
Add the URL
http://locallhost:{PORT}
and save the model as an ML backend. -
Label in interactive mode
To use this functionality, activate Auto-Annotation.
To ensure smooth deployment in regions with internet restrictions:
- Configure Docker daemon with proxy:
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
- add support for keypoints and obb.
Model training is not included in this project. This will probably be added later.
Contributions to this project are welcome. To contribute, please submit an issue or pull request.