刚开始学习,不断更新中…
【安装】
github地址
注意避坑:
- torchvision和pytorch一起在官网安装好
- python 3.6以上
- cuda驱动提前安装好
通过本地安装:
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
pip3 install -e .
下载预训练模型:官网地址
【demo测试】
官网地址
在detectron2目录下放入测试图片input.jpg,同级新建输出文件夹output,新建模型文件夹models,放入上面下载的预训练模型。
python3 demo/demo.py --config-file configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml \
--input input.jpg \
--output output \
--opts MODEL.WEIGHTS models/model_final_721ade.pkl
原图

检测结果


本文详细介绍如何使用Detectron2进行目标检测,包括环境搭建、预训练模型下载、配置文件解读及运行demo测试。从安装到测试,手把手教你完成整个流程。
2万+

被折叠的 条评论
为什么被折叠?



