PointRend 论文源码detetron2 安装及测试

本文详细介绍如何使用Anaconda环境安装PyTorch、TorchVision、PyCOCOTools及Detectron2等深度学习框架,包括创建虚拟环境、安装依赖库、升级GCC、安装预构建的Detectron2等步骤。
部署运行你感兴趣的模型镜像

安装anaconda

 

1 创建虚拟环境并激活:

conda create -n mask python=3.6

conda activate mask

 

2 安装pytorch 和torchvision

目前最新版本即为1.4.0,所以直接安装

pytthon -m pip install torch torchvision

 

3 安装pycocotools:

pip install cython; pip install -U / 'git+https://gitee.com/cubone/cocoapi.git#subdirectory=PythonAPI'

国内源,下载速度更快

 

4 升级gcc到5.0以上(如果gcc已经不低于此版本,可以路过)

查看gcc版本:gcc --version

centos升级流程:

https://blog.youkuaiyun.com/yimingfei/article/details/105535894

 

5 安装detectron2

python -m pip install 'git+https://gitee.com/junfengchen2016/facebookresearch_detectron2.git'

或者

git clone https://gitee.com/junfengchen2016/facebookresearch_detectron2.git

cd detectron2 && python -m pip install -e .

国内源,下载速度快。我选择了第二种

 

6 安装Pre-Built Detectron2

# for CUDA 10.1:

python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/index.html

我cuda 版本是10.1,直接运行此命令。

查看cuda版本命令:

cat /usr/local/cuda/version.txt

其它版本或cpu,则最后网页更改为:

cuda10.0 https://dl.fbaipublicfiles.com/detectron2/wheels/cu100/index.html

cuda9.2 https://dl.fbaipublicfiles.com/detectron2/wheels/cu92/index.html

cpu https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/index.html

 

安装完成

 

 

测试:

cd demo

cd demo/python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \  --input input1.jpg input2.jpg \ --output output --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

其中,测试图片需要自己指定,输出路径要先创建,权重文件如没有会自动下载

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值