Python 官方文档:入门教程 => 点击学习
源码位置:https://GitHub.com/facebookresearch/segment-anything 一、下载 pip install git+Https://github.com/fa
源码位置:https://GitHub.com/facebookresearch/segment-anything
pip install git+Https://github.com/facebookresearch/segment-anything.git
或者 直接下载,解压到当前文件夹,并把解压出的文件夹名字改成segment-anything
进入segment-anything文件夹
cd segment-anything
安装
pip install -e .
安装其他依赖
pip install OpenCV-python pycocotools matplotlib onnxruntime onnx
下载模型文件到segment-anything文件夹内
default or vit_h:
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
vit_l:
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
vit_b:
https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
下载数据集
https://ai.facebook.com/datasets/segment-anything-downloads/
或者用自己的图片数据集
整体文件结构
Python scripts/amg.py --checkpoint <path/to/checkpoint> --model-type <model_type> --input <image_or_folder> --output <path/to/output>
例如:在D:\PythonProject\segment-anything\test\input
文件夹下放入图片,使用vit_b
模型sam_vit_b_01ec64.pth
,输出到D:\PythonProject\segment-anything\test\output
文件夹内
python scripts/amg.py --checkpoint sam_vit_b_01ec64.pth --model-type vit_b --input D:\PythonProject\segment-anything\test\input --output D:\PythonProject\segment-anything\test\output
输入:
输出:
来源地址:https://blog.csdn.net/koukutou_mikiya/article/details/130281945
--结束END--
本文标题: SAM(segment anything model)本地部署复现
本文链接: https://lsjlt.com/news/391222.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0