open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.12k stars 9.38k forks source link

How to visualize Class DetDataSample results in image #11053

Open 0coldmoon0 opened 11 months ago

0coldmoon0 commented 11 months ago
from mmdet.apis import init_detector, inference_detector

config_file = 'rtmdet_tiny_8xb32-300e_coco.py'
checkpoint_file = 'rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth'
model = init_detector(config_file, checkpoint_file, device='cpu')  # or device='cuda:0'
inference_detector(model, 'demo/demo.jpg')

Above is the code for the Verification installation section in the official documentation. In previous versions of the mmdet,i can use show_result_pyplot( ) to visualize the result in image.

from mmdet.apis import show_result_pyplot

But in latest mmdet i can't import show_result_pyplot( ) from mmdet.apis. How can i visualize Class DetDataSample results in image in latest mmdet?

sabrina19950113 commented 6 months ago

Check this out. https://github.com/open-mmlab/mmdetection/issues/10829#issuecomment-1763519179