使用mmdet快速搭建识别模型网络

使用mmdet快速搭建识别模型网络

CGC Lv4

点击此处访问openmmdetection源码仓库

选择模型

使用命令行下载配置文件和模型权重文件

1
mim download mmyolo --config yolov5_s-v61_syncbn_fast_8xb16-300e_coco --dest .

搭建识别网络

1
2
3
4
5
6
7
8
9
from mmdet.apis import init_detector, inference_detector

config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
device = 'cuda:0'
# 初始化检测器
model = init_detector(config_file, checkpoint_file, device=device)
# 推理演示图像
inference_detector(model, 'demo.jpg')
  • Title: 使用mmdet快速搭建识别模型网络
  • Author: CGC
  • Created at: 2023-03-22 17:29:27
  • Updated at: 2023-03-26 16:21:31
  • Link: https://redefine.ohevan.com/2023/03/22/使用mmdet快速搭建识别模型网络/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
使用mmdet快速搭建识别模型网络