项目github地址:https://github.com/facebookresearch/detectron2
要求:
Python ≥ 3.6
PyTorch ≥ 1.3
OpenCV(用于可视化)
pycocotools
Python安装:网上教程很多
PyTorch 安装:https://pytorch.org/get-started/locally/ (自己选择需要版本即可,需选择安装cuda)
如(win+pip版本):
pip install -U torch==1.4+cu100 torchvision==0.5+cu100 -f https://download.pytorch.org/whl/torch_stable.html
OpenCV安装
pip install opencv-python
pycocotools安装:
pip install cython pyyaml==5.1
pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
(第二句需要安装git,教程地址:git安装)
Detectron2 安装:
pip install detect