Shortcuts

mmrotate

mmrotate.models

backbones

dense_heads

detectors

losses

roi_heads

mmrotate.core

mmrotate.datasets

class mmrotate.datasets.DOTADataset(ann_file, pipeline, version='oc', difficulty=100, **kwargs)[源代码]

DOTA dataset for detection.

参数
  • ann_file (str) – Annotation file path.

  • pipeline (list[dict]) – Processing pipeline.

  • version (str, optional) – Angle representations. Defaults to ‘oc’.

  • difficulty (bool, optional) – The difficulty threshold of GT.

evaluate(results, metric='mAP', logger=None, proposal_nums=(100, 300, 1000), iou_thr=0.5, scale_ranges=None, nproc=4)[源代码]

Evaluate the dataset.

参数
  • results (list) – Testing results of the dataset.

  • metric (str | list[str]) – Metrics to be evaluated.

  • logger (logging.Logger | None | str) – Logger used for printing related information during evaluation. Default: None.

  • proposal_nums (Sequence[int]) – Proposal number used for evaluating recalls, such as recall@100, recall@1000. Default: (100, 300, 1000).

  • iou_thr (float | list[float]) – IoU threshold. It must be a float when evaluating mAP, and can be a list when evaluating recall. Default: 0.5.

  • scale_ranges (list[tuple] | None) – Scale ranges for evaluating mAP. Default: None.

  • nproc (int) – Processes used for computing TP and FP. Default: 4.

format_results(results, submission_dir=None, nproc=4, **kwargs)[源代码]

Format the results to submission text (standard format for DOTA evaluation).

参数
  • results (list) – Testing results of the dataset.

  • submission_dir (str, optional) – The folder that contains submission

  • files. – If not specified, a temp folder will be created. Default: None.

  • nproc (int, optional) – number of process.

返回

(result_files, tmp_dir), result_files is a dict containing

the json filepaths, tmp_dir is the temporal directory created for saving json files when submission_dir is not specified.

返回类型

tuple

load_annotations(ann_folder)[源代码]
Params:

ann_folder: folder that contains DOTA v1 annotations txt files

merge_det(results, nproc=4)[源代码]

Merging patch bboxes into full image.

Params:

results (list): Testing results of the dataset. nproc (int): number of process. Default: 4.

class mmrotate.datasets.HRSCDataset(ann_file, pipeline, img_subdir='JPEGImages', ann_subdir='Annotations', classwise=False, version='oc', **kwargs)[源代码]

HRSC dataset for detection.

参数
  • ann_file (str) – Annotation file path.

  • pipeline (list[dict]) – Processing pipeline.

  • img_subdir (str) – Subdir where images are stored. Default: JPEGImages.

  • ann_subdir (str) – Subdir where annotations are. Default: Annotations.

  • classwise (bool) – Whether to use all classes or only ship.

  • version (str, optional) – Angle representations. Defaults to ‘oc’.

evaluate(results, metric='mAP', logger=None, proposal_nums=(100, 300, 1000), iou_thr=0.5, scale_ranges=None, use_07_metric=True, nproc=4)[源代码]

Evaluate the dataset.

参数
  • results (list) – Testing results of the dataset.

  • metric (str | list[str]) – Metrics to be evaluated.

  • logger (logging.Logger | None | str) – Logger used for printing related information during evaluation. Default: None.

  • proposal_nums (Sequence[int]) – Proposal number used for evaluating recalls, such as recall@100, recall@1000. Default: (100, 300, 1000).

  • iou_thr (float | list[float]) – IoU threshold. It must be a float when evaluating mAP, and can be a list when evaluating recall. Default: 0.5.

  • scale_ranges (list[tuple] | None) – Scale ranges for evaluating mAP. Default: None.

  • use_07_metric (bool) – Whether to use the voc07 metric.

  • nproc (int) – Processes used for computing TP and FP. Default: 4.

load_annotations(ann_file)[源代码]

Load annotation from XML style ann_file.

参数

ann_file (str) – Path of Imageset file.

返回

Annotation info from XML file.

返回类型

list[dict]

class mmrotate.datasets.SARDataset(ann_file, pipeline, version='oc', difficulty=100, **kwargs)[源代码]

SAR ship dataset for detection (Support RSSDD and HRSID).