Ubuntu18.04 configure detectron2 to achieve Faster RCNN target detection and Mask RCNN instance segmentation (1)

1. Background introduction

2. Environmental requirements

  • Ubuntu 18.04
  • CUDA10
  • pytorch==1.3.0
  • torchvision==0.4.1
  • pycocotools

3. Installation steps

3.1 Installation dependencies

  • cocoapi
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install
  • Cython
pip install cython

3.2 Install detectron2

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2 && python -m pip install -e .

4. Test the installation

After the installation is complete, you can enter the following command to test whether the installation is successful.

python3 demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
  --input cat.jpg \
  --output result_cat.jpg \
  --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

The input picture is: the
cat.img
result picture is: the
result.jpg
test is successful, indicating that the installation is successful, and the framework can be used for further training, testing, etc.

Guess you like

Origin blog.csdn.net/linghu8812/article/details/105701408