ISAM半自动图像分割标注工具本地部署

创建虚拟环境ISAT_with_segment_anything

conda create -n ISAT_with_segment_anything python==3.8
conda activate ISAT_with_segment_anything

安装Segment anything 

GitHub - facebookresearch/segment-anything: The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model. - GitHub - facebookresearch/segment-anything: The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.https://github.com/facebookresearch/segment-anything项目下载到本地之后

pip install -e .

3个权重文件,base最小,large中等,huge最大 ,根据电脑性能选个合适的。

显存至少需求6G

https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth

显存至少需求8Ghttps://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth

https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth 

显存至少需求8G

https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth 

 

安装ISAT_with_segment_anything 

GitHub - yatengLG/ISAT_with_segment_anything: Interactive semi-automatic image segmentation annotation tool.(交互式半自动图像分割标注工具)Interactive semi-automatic image segmentation annotation tool.(交互式半自动图像分割标注工具) - GitHub - yatengLG/ISAT_with_segment_anything: Interactive semi-automatic image segmentation annotation tool.(交互式半自动图像分割标注工具)https://github.com/yatengLG/ISAT_with_segment_anything

pip install -r requirements.txt

 运行main.py会报错ModuleNotFoundError: No module named 'pycocotools'

在虚拟环境ISAT_with_segment_anything中,本地安装pycocotools

Links for pycocotools-windowsicon-default.png?t=N3I4https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools-windows/

pip install pycocotools_windows-2.0.0.2-cp37-cp37m-win_amd64.whl

运行main.py

默认安装的cpu版本

 

用CPU版本也行,就是显卡没被使用,速度慢,需要替换为GPU版本就先卸载。

查看一下当前的版本

pip list

torch                     1.8.1
torchvision            0.9.1

官网下载对应的gpu版本的torch,Start Locally | PyTorch

 https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp38-cp38-win_amd64.whl

pip uninstall torch
pip uninstall torchvision
pip install torch torchvision F:\迅雷下载\torch-2.0.1+cu117-cp38-cp38-win_amd64.whl

 再查看一下当前的版本

torch                     2.0.1+cu117
torchvision            0.15.2

再次启动,就是GPU版本的了。

 小功告成

使用教程,可以看作者的视频【集成SAM(segment anything model)的图像分割标注工具】 

<iframe src="//player.bilibili.com/player.html?aid=740343784&bvid=BV1Lk4y1J7uB&cid=1105879681&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe> 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值