Ubuntu下安装detectron2

1、安装python环境

conda create -n detectron2_env python==3.8

请添加图片描述

2、激活安装的python环境

conda activate detectron2_env

请添加图片描述

3、安装torch包

conda install pytorch=1.10.1 torchvision=0.11.2 cudatoolkit=11.3 -c pytorch

请添加图片描述

4、安装detectron2

https://detectron2.readthedocs.io/en/latest/tutorials/install.html

请添加图片描述

python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html

请添加图片描述

5、安装opencv

pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple

请添加图片描述

6、运行demo

python demo.py --input '/home/redmery/Desktop/pedestrain_detection_with_occlusion/datasets/coco128/images/train2017/000000000049.jpg'

请添加图片描述
结果如下所示:
请添加图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐