This project contains an ML backend for segmenting and detecting pills in Label Studio. It uses the YOLOv8 model and can segment or detect and classify pills as capsules or tablets.
-
Dockerfile: The Dockerfile for building the backend container.
-
docker-compose.yml: The docker-compose file for running the backend.
-
model.py: The Python code for the ML backend model for image detection (RectangleLabels).
-
best.pt: The pre-trained YOLOv8 model for pill classification.
-
requirements.txt: The list of Python dependencies for the backend.
Refer to https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/grounding_dino for additional information.
-
Clone the Label Studio Machine Learning Backend git repository.
-
Paste you Label Studio IP and API key in
model.py
. -
Update self.labels based on your model.
-
To use this backend, you'll need to have Docker and docker-compose installed. Then, run the following command to start the backend:
docker-compose up
This will start the backend on localhost:11302.
Check if it works:
$ curl http://localhost:11302/health
{"status":"UP"}
-
Connect running backend to Label Studio:
label-studio start --init new_project --ml-backends http://localhost:11302
Or write it manually in Settings - Machine - Add Model.
- Start the labeling process.
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.