Skip to content

MDI machine learning SAM model server. Segment WSI(whole slide image) , simple images.

License

Notifications You must be signed in to change notification settings

Zach-77/mdi-sam-server

Repository files navigation

MDI SAM Server

Medical Data Inteligence Lab

Cheng ZHANG

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

WSI segmentation annotation

point & rectangle模式



Supporting models:

Installation

The Python used in the development process of this version is 3.10. Please use this version or an updated version.

pip install -e .

How to run

  • 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

About

MDI machine learning SAM model server. Segment WSI(whole slide image) , simple images.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.3%
  • Shell 5.3%
  • Dockerfile 1.4%