南开区网站建设,做网站百度,哪家的云服务器便宜,一天必赚100元的游戏文章目录 一. segment-anything安装教程 一. segment-anything安装教程
官网安装说明:https://github.com/facebookresearch/segment-anything anaconda下新建一个环境 conda create -n sam python3.8激活新建的环境 conda activate sam更换conda镜像源 conda config --add ch… 文章目录 一. segment-anything安装教程 一. segment-anything安装教程
官网安装说明:https://github.com/facebookresearch/segment-anything anaconda下新建一个环境 conda create -n sam python3.8激活新建的环境 conda activate sam更换conda镜像源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/安装pytorch conda install pytorch1.11.0 torchvision0.12.0 torchaudio0.11.0 cudatoolkit11.3克隆官方代码 git clone gitgithub.com:facebookresearch/segment-anything.git进入下载好的文件夹打开cmd激活安装好的环境运行以下代码 pip install -e . -i https://mirrors.aliyun.com/pypi/simple/安装所需python库 pip install opencv-python pycocotools matplotlib onnxruntime onnx flake8 isort black mypy -i https://mirrors.aliyun.com/pypi/simple/从官网下载模型并复制到源代码下 运行以下代码 1.png为放置在源代码下的图像 python scripts/amg.py --checkpoint sam_vit_b_01ec64.pth --model-type vit_b --input 1.jpg --output result生成的图像掩码