Segment Any Medical-Model (SAMM): A 3D Slicer integration to Meta's SAM. 实践

论文: https://arxiv.org/abs/2304.05622

项目: https://github.com/bingogome/samm

系统:windows 10

下载 https://download.slicer.org/

下载 git https://git-scm.com/download/win

直接下载两个压缩包,放到你想放的目录中,并解压。

https://github.com/bingogome/samm/archive/refs/heads/main.zip

https://github.com/facebookresearch/segment-anything/archive/refs/heads/main.zip

cd segment-anything-main/
pip install -e .
pip install opencv-python matplotlib onnxruntime onnx -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装报错:

pip install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple/

错误:

building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for pycocotools

解决:
conda install pycocotools -c conda-forge

image

预训练模型 2.4G:https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

image

image

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

3D slicer -> Developer Tools→ Extension Wizard。

Extension Tools-> Select Extension-> 导入 samm/samm 文件夹。

目前问题: 我加载图像后

image

image

python .\samm-python-terminal\sam_server.py

image

我输出的和 DEMO 的不一样呀??我什么结果也没得到。可能我没有 GPU 的问题?
我把下面这行改为了 cpu。sam_server.py 的 36 行。
self.device = "cpu"

posted @   Zenith_Hugh  阅读(607)  评论(7编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!

喜欢请打赏

扫描二维码打赏

微信打赏

点击右上角即可分享
微信分享提示