mmdetection demo

Published by onesixx on

get_started.md for the basic usage of MMDetection. 

https://junha1125.github.io/blog/pytorch-docker-git/2021-01-15-mmdetection1/

# mim download mmdet --config faster_rcnn_r50_fpn_1x_coco --dest .

from mmdet.apis import init_detector, inference_detector, show_result_pyplot
config_file     = './faster_rcnn_r50_fpn_1x_coco.py'
checkpoint_file = './faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
device = 'cuda:0'
img = '../demo/demo.jpg'

model = init_detector(config_file, checkpoint_file, device=device)
result= inference_detector(model, img)

print(result)
show_result_pyplot(model, img, result, score_thr=0.3)

Getting Started

Categories: vision

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x