【Faster RCNN detectron2】detectron2实现Faster RCNN目标检测
生活随笔
收集整理的這篇文章主要介紹了
【Faster RCNN detectron2】detectron2实现Faster RCNN目标检测
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
- 1. 背景介紹
- 2.安裝步驟
- 3.Faster RCNN目標檢測
- 4. 效果
- 5.錯誤解決
- 6.參考博客
- 7,下一節代碼解析
在上一篇博客記錄了 SlowFast的復現過程,slowfast其中有一部分是detectron2實現Faster RCNN對人的目標檢測。
這一篇博客就單獨記錄detectron2實現Faster RCNN目標檢測的解析
B站視頻講解
1. 背景介紹
- detectron2項目地址
- detectron2文檔
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_repo3.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.pkl4. 效果
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-glx6.參考博客
Ubuntu18.04 配置detectron2實現Faster RCNN目標檢測和Mask RCNN實例分割(一)
7,下一節代碼解析
【代碼解析】顯示detectron2中faster R-CNN的檢測結果,利用visualizer顯示
?
總結
以上是生活随笔為你收集整理的【Faster RCNN detectron2】detectron2实现Faster RCNN目标检测的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python爬虫 单线程的多任务异步协程
- 下一篇: 九、华为鸿蒙HarmonyOS应用开发之