Segmentation Models Pytorch (SMP) 是一个基于 PyTorch 的 python 库,使用神经网络对图片进行分割的 。
https://github.com/qubvel/segmentation_models.pytorch
安装 pip
conda install pip
设置国内的镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
因为安装时会自动下载 pytorch,大概 160M,要想加速还是换国内的源比较好。上面是清华大学的源。
安装 SMP
pip install segmentation-models-pytorch
确认
> python
Python 3.10.9 | packaged by Anaconda, Inc.
>>> import segmentation_models_pytorch as smp
>>> smp.__version__
'0.3.2'