【Faster RCNN & detectron2】detectron2实现Faster RCNN目标检测


在上一篇博客记录了 SlowFast的复现过程,slowfast其中有一部分是detectron2实现Faster RCNN对人的目标检测。

这一篇博客就单独记录detectron2实现Faster RCNN目标检测的解析

B站视频讲解

1. 背景介绍

2.安装步骤

安装:

pip install -U torch torchvision cython
pip install -U 'git+https://github.com/facebookresearch/fvcore.git' 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
git clone https://github.com/facebookresearch/detectron2 detectron2_repo
pip install -e detectron2_repo

3.Faster RCNN目标检测

在终端输入:

python3 demo.py --config-file ../configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml \
  --input ../img/1.JPG \
  --output ../img/1_1.jpg \
  --opts MODEL.WEIGHTS detectron2://COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl

4. 效果

在这里插入图片描述

5.错误解决

运行过程中可能会出现

Traceback (most recent call last):
File “demo.py”, line 7, in
import cv2
File “/opt/conda/lib/python3.7/site-packages/cv2/init.py”, line 5, in
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

解决方案:

在终端运行:

apt update
apt install libgl1-mesa-glx

6.参考博客

Ubuntu18.04 配置detectron2实现Faster RCNN目标检测和Mask RCNN实例分割(一)

7,下一节代码解析

【代码解析】显示detectron2中faster R-CNN的检测结果,利用visualizer显示

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CSPhD-winston-杨帆

给我饭钱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值