def inference_detector_by_patches(model, img, sizes, steps, ratios, merge_iou_thr, bs=1): """inference patches with the detector. Split huge image(s) into patches and inference them with the detector. Finally, merge patch results on one huge image by nms. Args: model (nn.Module): Th...
Split huge image(s) into patches and inference them with the detector. Finally, merge patch results on one huge image by nms. Args: model (nn.Module): The loaded detector. img (str | ndarray or): Either an image file or loaded image. sizes (list): The sizes of patches. steps (list...
apis import init_detector, inference_detector import mmrotate config_file = 'oriented_rcnn_r50_fpn_1x_dota_le90.py' checkpoint_file = 'oriented_rcnn_r50_fpn_1x_dota_le90-6d2b2ce0.pth' model = init_detector(config_file, checkpoint_file, device='cuda:0') inference_detector(model, '...
# build the model from a config file and a checkpoint file model = init_detector(args.config, args.checkpoint, device=args.device) # test a single image result = inference_detector(model, args.img) # show the results show_result_pyplot( model, args.img, result, palette=args.palette, sco...
InferencePyTorchJittorPyTorchTensorFlowPyTorch engineonnx runtime OSLinuxWindowsWindowsLinuxWindows LinuxLinuxLinux Algorithm5891618 Dataset145114 Doc.---✓✓ Easy install---✓ Maintain-✓✓✓✓ Table 2.Accuracy comparison of rotated object detectors on DOTA v1.0. MS means multiple scale image...
import numpy as np import torch import torchvision.transforms as T from PIL import Image from mmdet.apis import inference_detector, init_detector import mmrotate # noqa: F401 transform = T.Compose([ T.ToTensor(), ]) # 加载配置文件和模型权重 config_file = "configs/robustRDet/lsk_s_fpn_1x...
(type='Collect', # Pipeline that decides which keys in the data should be passed to the detector keys=['img', 'gt_bboxes', 'gt_labels']) ] test_pipeline = [ dict(type='LoadImageFromFile'), # First pipeline to load images from file path dict( type='MultiScaleFlipAug', # An ...
apis import init_detector, inference_detector import mmrotate config_file = 'oriented_rcnn_r50_fpn_1x_dota_le90.py' checkpoint_file = 'oriented_rcnn_r50_fpn_1x_dota_le90-6d2b2ce0.pth' model = init_detector(config_file, checkpoint_file, device='cuda:0') inference_detector(model, '...
from mmdet.apis import inference_detector, init_detector, show_result_pyplot import mmrotate # noqa: F401 def parse_args(): parser = ArgumentParser() parser.add_argument('img', help='Image file') parser.add_argument('config', help='Config file') ...