MDI annotation platform SAM1 & SAM2 (and other SAM Family models) real-time recognition server ⚡ . You can use this server to generate the mask of image that you post with points (negative, positive), box, or both. You can install the server as label studio machine learning backend.The service references open source projects like Label-Studio, playgroud, SAM. Current support:
- (1) Real time annotation: multi-point annotation, single rectangle annotation
- (2) Prompt with different positive and negative values
- (3) the Whole Slide Image recognition
- 1.Meta SAM
- 2.Meta SAM2
- 3.mobile_sam
- 4.ONNX mode
The Python used in the development process of this version is 3.10. Please use this version or an updated version.
pip install -e .
- Use server command
SAM_CHOICE=SAM2 \
SAM2_CHECKPOINT=./models/sam2_hiera_base_plus.pt \
SAM2_CONFIG=sam2_hiera_b+.yaml \
mdi_sam_server run --port 9011 --log-level INFO --env-path /home/mdi/zhangcheng-dev/mdi-sam-server/.env
# Parameter explanation:
# SAM_CHOICE: SAM model type chioce
# SAM2_CHECKPOINT: SAM model checkpoint
# SAM2_CONFIG: SAM2 config
# --env-path: enviroment value config
#...
- Use shell
cd src/
SAM_DRAW_MODE=true \
SAM_CHOICE=SAM2 \
SAM2_CHECKPOINT=../models/sam2_hiera_large.pt \
SAM2_CONFIG=sam2_hiera_l.yaml \
python run_server.py run --port 9014 --log-level INFO --env-path
- Explanation: The request body adopts JSON mode, and the request header contains a token for verification Request header: Content Type: application/JSON; token:xxxx