Segment-Anything model for my own use
sam_vit_b_01ec64.pth:b表示base(最小)
sam_vit_h_4b8939.pth:h表示huge(最大)
sam_vit_l_0b3195.pth:l表示large
克隆仓库:git clone https://github.com/facebookresearch/segment-anything
安装项目(-e后的英文句点需要输入的):cd segment-anything; pip install -e .
克隆仓库: git clone https://github.com/Jerry00917/samshap.git
conda create --name SAM python=3.9
source activate SAM
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install torch==1.13.1 torchvision==0.14.1 --extra-index-url https://download.pytorch.org/whl/cu113 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple/
cd
into SAM4own/meta_sam_checkpoints
sh run_download_checkpoints.sh
cd
into SAM4own
python run.py
cd
into samshap-hkust
python demo_samshap.py
- SAMSHAT使用了ResNet50的权重文件,在
demo_samshap.py
可对models.resnet50(weights='IMAGENET1K_V2')
进行更换修改