参考:
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 依赖库
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 插件
七、启动服务
./samm/samm-python-terminal/sam_server.py
八、使用samm
有一个小技巧,记得重采样影像