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'
结果如下所示: