Segment Any Medical-Model (SAMM)在3D slicer上部署

参考:

GitHub - bingogome/samm: A 3D Slicer integration to Meta's SAM.

https://www.cnblogs.com/odesey/p/17322413.html

一、下载代码仓库和权重文件

https://github.com/facebookresearch/segment-anything.git
https://github.com/bingogome/samm.git
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

二、安装依赖库

pip install opencv-python matplotlib onnxruntime onnx

三、安装3D slicer

https://download.slicer.org/

四、安装3D slicer 依赖库

Segment Any Medical-Model (SAMM)在3D slicer上部署_第1张图片

slicer.util.pip_install("pyyaml")
slicer.util.pip_install("pyzmq")

 五、将segment-anything相关文件拷贝到对应目录

1、将.\segment-anything\segment_anything拷贝到.\samm\segment_anything
2、将sam_vit_h_4b8939.pth拷贝到.\samm\samm-python-terminal\samm-workspace\sam_vit_h_4b8939.pth

六、安装3Dslicer 插件

Segment Any Medical-Model (SAMM)在3D slicer上部署_第2张图片

Segment Any Medical-Model (SAMM)在3D slicer上部署_第3张图片

Segment Any Medical-Model (SAMM)在3D slicer上部署_第4张图片

 七、启动服务

./samm/samm-python-terminal/sam_server.py

Segment Any Medical-Model (SAMM)在3D slicer上部署_第5张图片

 八、使用samm

Segment Any Medical-Model (SAMM)在3D slicer上部署_第6张图片

 Segment Any Medical-Model (SAMM)在3D slicer上部署_第7张图片

有一个小技巧,记得重采样影像

你可能感兴趣的:(python,pytorch,人工智能,深度学习,c++)