安装

目前有三种安装方式

  1. 源码运行(推荐)

  2. 通过pip安装

  3. 通过exe安装


方式1:源码运行

  1. 创建虚拟环境

    conda create -n isat_env python=3.8
    conda activate isat_env
    
  2. 获取ISAT_with_segment_anything源码并安装依赖windows系统下,通过pip安装的pytorch默认是cpu版本,gpu版本的pytorch需去 pytorch 官网手动安装。

    git clone https://github.com/yatengLG/ISAT_with_segment_anything.git
    cd ISAT_with_segment_anything
    pip install -r requirements.txt
    
  3. 下载Segment anything预训练模型: 保存到以下目录``ISAT_with_segment_anything/ISAT/checkpoints``

    软件提供了模型管理界面。通过[菜单栏]-[SAM]-[模型管理]打开界面(现已添加模型国内下载链接,点击下载按钮可直接进行下载)

    Now support SAM2, SAM, Sam-HQ, MobileSAM, and EdgeSAM etc.

    预训练模型权重

    模型

    预训练模型权重

    内存

    大小

    SAM

    sam_vit_h_4b8939.pth

    7305M

    2.6G

    sam_vit_l_0b3195.pth

    5855M

    2.6G

    sam_vit_b_01ec64.pth

    4149M

    375M

    sam-hq

    sam_hq_vit_h.pth

    7393M

    2.6G

    sam_hq_vit_l.pth

    5939M

    1.3G

    sam_hq_vit_b.pth

    4207M

    379M

    sam_hq_vit_tiny.pth

    1463M

    43M

    mobile-sam

    mobile_sam.pt

    1375M

    40M

    edge-sam

    edge_sam.pth

    960M

    39M

    edge_sam_3x.pth

    960M

    39M

    sam-med

    sam-med2d_b.pth

    1500M

    2.4G

    SAM2

    sam2_hiera_large.pt

    4000M

    900M

    sam2_hiera_base_plus.pt

    4000M

    324M

    sam2_hiera_small.pt

    3000M

    185M

    sam2_hiera_tiny.pt

    2400M

    156M

  4. 运行软件

    python main.py
    

方式2:pip安装 (版本略低于源码)

  1. 创建虚拟环境

    conda create -n isat_env python=3.8
    conda activate isat_env
    
  2. windows系统下,通过pip安装的pytorch默认是cpu版本,gpu版本的pytorch需去 pytorch 官网手动安装。

    pip install isat-sam
    
  3. 运行软件

    isat-sam
    

方式3:windows下exe运行 (版本严重落后于源码)

  1. 下载打包好的exe文件

    • 需下载三个.zip文件,总体大小2.7G,解压缩后4.9G。

    • 下载链接: 百度网盘 密码: ISAT

    双击main.exe运行

  2. 下载Segment anything预训练模型打包后的软件,附带了 sam_hq_vit_tiny.pth ,便于直接使用 ( 近期有朋友反馈,sam_hq_vit_tiny.pth无法在CPU环境下运行,这是由于sam-hq模型权重保存的问题。请下载 mobile-sam.pt 权重后选择mobile-sam模型 )

    如需使用精度更高的模型,请自行下载,并放置于ISAT/segment_any下(打包的exe为旧版本,还未更新)。下载地址同上