This repository provides a machine annotation service for plant organ segmentation, designed to facilitate the extraction of additional information from herbarium sheets. It includes a trained model checkpoint and the necessary scripts to deploy and test the system.
conda create -n plant_organ_segmentation python=3.12.3
conda activate plant_organ_segmentation
To set up the environment, follow these steps:
-
Install required dependencies for the service:
pip install -r requirements_service.txt pip install -r requirements_inference.txt
To start the server using uvicorn
, run the service.py
script. This will initialize the server and allow it to handle incoming requests for plant organ segmentation.
Start the service:
python service.py
The uvicorn
service forwards incoming requests to the WebSocket, where inference is performed and additional information such as surface area and other plant organ properties are extracted. To run the WebSocket process and handle inference, execute the following command:
To start the websocket for Mask R-CNN model inference:
python inference.py
or to start the websocket for YOLO11 model inference:
python inference_yolo.py
To test the service with images, the test.py
script performs inference on the images located in the test_image/scans
directory and outputs the results.
Run the standalone test:
python test.py