hello.mmdet.infer module¶
pip install mmdet
- class hello.mmdet.infer.Detector(config_file, checkpoint_file, device='cuda:0', cfg_options=None)[source]¶
Bases:
objectInstantiate an object detector.
>>> cfg_options = {"data.test.pipeline.1": dict(img_scale=(800, 800), scale_factor=None)} >>> cfg_options = {"data.test.pipeline.1": dict(img_scale=None, scale_factor=1.0)}
- Parameters:
config_file (str) – Config file path.
checkpoint_file (str) – Checkpoint file path.
device (str, optional) – Device used for calculating. Defaults to “cuda:0”.
cfg_options (dict, optional) – Options to override some settings. Defaults to None.
- test_image(image_path, score_thr=0.3, out_file=None)[source]¶
Inference image with the detector.
- Parameters:
img (str) – Image file.