-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Add an ionogram example in MMYOLO application (#643)
* [Fix] fix the config link for rtmdet_tiny * fir the lint * upload configs * [Docs]Add doc for application examples * [Doc] fix h1 title for ionogram_detection.md * [Fix] update doc links for project/misc/ * Update links for application_examples in README * Update links for application_examples in README * Fix the bad commit caused by a mistake merge. * Fix unnecessary modification on Table of Contents * Add description of dataset preparation * Add description of dataset preparation * Update dataset analysis and pipeline visualization * fix line too long * Update rtmdet_s in the benchmark * fix typo in the doc * Replace local ckpt path with url * Update file tree, check out for spaces * Beautify configs * Beautify configs * Add introduction of annotation tool * Update rtmdet benchmark * Update rtmdet configs * Fix typo * Add English doc * Minor revisio * Fix typo * Revision - check labels Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - sentence structure Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - fix typo Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - parameters and FLOPs Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - replace flops with FLOPs Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - enhance readability Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - fix typo Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - correct grammatical errors Co-authored-by: Range King <RangeKingHZ@gmail.com> * Revision - enhance Co-authored-by: Range King <RangeKingHZ@gmail.com> --------- Co-authored-by: Range King <RangeKingHZ@gmail.com>
- Loading branch information
1 parent
cbf5a80
commit 71fc567
Showing
29 changed files
with
1,678 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MMYOLO application examples | ||
******************** | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
ionogram_detection.md |
307 changes: 307 additions & 0 deletions
307
docs/en/recommended_topics/application_examples/ionogram_detection.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MMYOLO 应用范例介绍 | ||
******************** | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
ionogram_detection.md |
306 changes: 306 additions & 0 deletions
306
docs/zh_cn/recommended_topics/application_examples/ionogram_detection.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Tips: 这个是自定义数据集的 config 文件,请结合 [自定义数据集教程](https://github.com/open-mmlab/mmyolo/blob/dev/docs/zh_cn/user_guides/custom_dataset.md) 来使用。 | ||
Tips: 这个是自定义数据集的 config 文件,请结合 [标注+训练+测试+部署全流程](https://github.com/open-mmlab/mmyolo/blob/main/docs/zh_cn/recommended_topics/labeling_to_deployment_tutorials.md) 来使用。 | ||
|
||
Tips: This is the config file of the custom dataset. Please use it in combination with [custom dataset](https://github.com/open-mmlab/mmyolo/blob/dev/docs/en/user_guides/custom_dataset.md). | ||
Tips: This is the config file of the custom dataset. Please use it in combination with [Annotation-to-deployment workflow for custom dataset](https://github.com/open-mmlab/mmyolo/blob/main/docs/en/recommended_topics/labeling_to_deployment_tutorials.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Tips: 这是 MMYOLO 应用范例的配置文件,请结合 [基于 MMYOLO 的频高图实时目标检测 benchmark](/docs/zh_cn/recommended_topics/application_examples/ionogram_detection.md) 来使用。 | ||
|
||
Tips: This is the config file of the MMYOLO application examples. Please use it in combination with [A Benchmark for Ionogram Detection Based on MMYOLO](/docs/en/recommended_topics/application_examples/ionogram_detection.md). |
107 changes: 107 additions & 0 deletions
107
projects/misc/ionogram_detection/rtmdet/rtmdet_l_fast_1xb32-100e_ionogram.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
_base_ = 'mmyolo::rtmdet/rtmdet_l_syncbn_fast_8xb32-300e_coco.py' | ||
|
||
# ======================== Modified parameters ====================== | ||
# -----data related----- | ||
data_root = './Iono4311/' | ||
train_ann_file = 'annotations/train.json' | ||
train_data_prefix = 'train_images/' | ||
val_ann_file = 'annotations/val.json' | ||
val_data_prefix = 'val_images/' | ||
test_ann_file = 'annotations/test.json' | ||
test_data_prefix = 'test_images/' | ||
|
||
class_name = ('E', 'Es-l', 'Es-c', 'F1', 'F2', 'Spread-F') | ||
num_classes = len(class_name) | ||
metainfo = dict( | ||
classes=class_name, | ||
palette=[(250, 165, 30), (120, 69, 125), (53, 125, 34), (0, 11, 123), | ||
(130, 20, 12), (120, 121, 80)]) | ||
|
||
train_batch_size_per_gpu = 32 | ||
train_num_workers = 8 | ||
val_batch_size_per_gpu = train_batch_size_per_gpu | ||
|
||
# Config of batch shapes. Only on val. | ||
batch_shapes_cfg = dict(batch_size=val_batch_size_per_gpu) | ||
|
||
# -----train val related----- | ||
load_from = 'https://download.openmmlab.com/mmyolo/v0/rtmdet/rtmdet_l_syncbn_fast_8xb32-300e_coco/rtmdet_l_syncbn_fast_8xb32-300e_coco_20230102_135928-ee3abdc4.pth' # noqa | ||
|
||
# default hooks | ||
save_epoch_intervals = 10 | ||
max_epochs = 100 | ||
max_keep_ckpts = 1 | ||
|
||
# learning rate | ||
param_scheduler = [ | ||
dict( | ||
type='LinearLR', start_factor=1.0e-5, by_epoch=False, begin=0, | ||
end=300), | ||
dict( | ||
# use cosine lr from 20 to 100 epoch | ||
type='CosineAnnealingLR', | ||
eta_min=_base_.base_lr * 0.05, | ||
begin=max_epochs // 5, | ||
end=max_epochs, | ||
T_max=max_epochs * 4 // 5, | ||
by_epoch=True, | ||
convert_to_iter_based=True), | ||
] | ||
|
||
# train_cfg | ||
val_interval = 2 | ||
val_begin = 20 | ||
|
||
tta_model = None | ||
tta_pipeline = None | ||
|
||
visualizer = dict( | ||
vis_backends=[dict(type='LocalVisBackend'), | ||
dict(type='WandbVisBackend')]) | ||
|
||
# ===================== Unmodified in most cases ================== | ||
model = dict( | ||
bbox_head=dict(head_module=dict(num_classes=num_classes)), | ||
train_cfg=dict(assigner=dict(num_classes=num_classes))) | ||
|
||
train_dataloader = dict( | ||
batch_size=train_batch_size_per_gpu, | ||
num_workers=train_num_workers, | ||
dataset=dict( | ||
metainfo=metainfo, | ||
data_root=data_root, | ||
ann_file=train_ann_file, | ||
data_prefix=dict(img=train_data_prefix))) | ||
|
||
val_dataloader = dict( | ||
batch_size=val_batch_size_per_gpu, | ||
num_workers=train_num_workers, | ||
dataset=dict( | ||
metainfo=metainfo, | ||
data_root=data_root, | ||
data_prefix=dict(img=val_data_prefix), | ||
ann_file=val_ann_file)) | ||
|
||
test_dataloader = dict( | ||
batch_size=val_batch_size_per_gpu, | ||
num_workers=train_num_workers, | ||
dataset=dict( | ||
metainfo=metainfo, | ||
data_root=data_root, | ||
data_prefix=dict(img=test_data_prefix), | ||
ann_file=test_ann_file)) | ||
|
||
default_hooks = dict( | ||
checkpoint=dict( | ||
interval=save_epoch_intervals, | ||
max_keep_ckpts=max_keep_ckpts, | ||
save_best='auto')) | ||
|
||
val_evaluator = dict(ann_file=data_root + val_ann_file) | ||
test_evaluator = dict(ann_file=data_root + test_ann_file) | ||
|
||
train_cfg = dict( | ||
type='EpochBasedTrainLoop', | ||
max_epochs=max_epochs, | ||
val_begin=val_begin, | ||
val_interval=val_interval) |
83 changes: 83 additions & 0 deletions
83
projects/misc/ionogram_detection/rtmdet/rtmdet_s_fast_1xb32-100e_ionogram.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
_base_ = './rtmdet_l_fast_1xb32-100e_ionogram.py' | ||
|
||
load_from = 'https://download.openmmlab.com/mmyolo/v0/rtmdet/rtmdet_s_syncbn_fast_8xb32-300e_coco/rtmdet_s_syncbn_fast_8xb32-300e_coco_20221230_182329-0a8c901a.pth' # noqa | ||
|
||
# ======================= Modified parameters ===================== | ||
deepen_factor = 0.33 | ||
widen_factor = 0.5 | ||
img_scale = _base_.img_scale | ||
|
||
# ratio range for random resize | ||
random_resize_ratio_range = (0.5, 2.0) | ||
# Number of cached images in mosaic | ||
mosaic_max_cached_images = 40 | ||
# Number of cached images in mixup | ||
mixup_max_cached_images = 20 | ||
|
||
# ===================== Unmodified in most cases ================== | ||
model = dict( | ||
backbone=dict(deepen_factor=deepen_factor, widen_factor=widen_factor), | ||
neck=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
bbox_head=dict(head_module=dict(widen_factor=widen_factor))) | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args), | ||
dict(type='LoadAnnotations', with_bbox=True), | ||
dict( | ||
type='Mosaic', | ||
img_scale=img_scale, | ||
use_cached=True, | ||
max_cached_images=mosaic_max_cached_images, | ||
pad_val=114.0), | ||
dict( | ||
type='mmdet.RandomResize', | ||
# img_scale is (width, height) | ||
scale=(img_scale[0] * 2, img_scale[1] * 2), | ||
ratio_range=random_resize_ratio_range, # note | ||
resize_type='mmdet.Resize', | ||
keep_ratio=True), | ||
dict(type='mmdet.RandomCrop', crop_size=img_scale), | ||
dict(type='mmdet.YOLOXHSVRandomAug'), | ||
dict(type='mmdet.RandomFlip', prob=0.5), | ||
dict(type='mmdet.Pad', size=img_scale, pad_val=dict(img=(114, 114, 114))), | ||
dict( | ||
type='YOLOv5MixUp', | ||
use_cached=True, | ||
max_cached_images=mixup_max_cached_images), | ||
dict(type='mmdet.PackDetInputs') | ||
] | ||
|
||
train_pipeline_stage2 = [ | ||
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args), | ||
dict(type='LoadAnnotations', with_bbox=True), | ||
dict( | ||
type='mmdet.RandomResize', | ||
scale=img_scale, | ||
ratio_range=random_resize_ratio_range, # note | ||
resize_type='mmdet.Resize', | ||
keep_ratio=True), | ||
dict(type='mmdet.RandomCrop', crop_size=img_scale), | ||
dict(type='mmdet.YOLOXHSVRandomAug'), | ||
dict(type='mmdet.RandomFlip', prob=0.5), | ||
dict(type='mmdet.Pad', size=img_scale, pad_val=dict(img=(114, 114, 114))), | ||
dict(type='mmdet.PackDetInputs') | ||
] | ||
|
||
train_dataloader = dict(dataset=dict(pipeline=train_pipeline)) | ||
|
||
custom_hooks = [ | ||
dict( | ||
type='EMAHook', | ||
ema_type='ExpMomentumEMA', | ||
momentum=0.0002, | ||
update_buffers=True, | ||
strict_load=False, | ||
priority=49), | ||
dict( | ||
type='mmdet.PipelineSwitchHook', | ||
switch_epoch=_base_.max_epochs - _base_.num_epochs_stage2, | ||
switch_pipeline=train_pipeline_stage2) | ||
] |
62 changes: 62 additions & 0 deletions
62
projects/misc/ionogram_detection/rtmdet/rtmdet_tiny_fast_1xb32-100e_ionogram.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
_base_ = './rtmdet_s_fast_1xb32-100e_ionogram.py' | ||
|
||
# ======================= Modified parameters ====================== | ||
deepen_factor = 0.167 | ||
widen_factor = 0.375 | ||
img_scale = _base_.img_scale | ||
|
||
load_from = 'https://download.openmmlab.com/mmyolo/v0/rtmdet/rtmdet_tiny_syncbn_fast_8xb32-300e_coco/rtmdet_tiny_syncbn_fast_8xb32-300e_coco_20230102_140117-dbb1dc83.pth' # noqa | ||
|
||
# learning rate | ||
param_scheduler = [ | ||
dict( | ||
type='LinearLR', start_factor=1.0e-5, by_epoch=False, begin=0, | ||
end=300), | ||
dict( | ||
# use cosine lr from 50 to 100 epoch | ||
type='CosineAnnealingLR', | ||
eta_min=_base_.base_lr * 0.05, | ||
begin=_base_.max_epochs // 2, | ||
end=_base_.max_epochs, | ||
T_max=_base_.max_epochs // 2, | ||
by_epoch=True, | ||
convert_to_iter_based=True), | ||
] | ||
|
||
# =======================Unmodified in most cases================== | ||
model = dict( | ||
backbone=dict(deepen_factor=deepen_factor, widen_factor=widen_factor), | ||
neck=dict(deepen_factor=deepen_factor, widen_factor=widen_factor), | ||
bbox_head=dict(head_module=dict(widen_factor=widen_factor))) | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args), | ||
dict(type='LoadAnnotations', with_bbox=True), | ||
dict( | ||
type='Mosaic', | ||
img_scale=img_scale, | ||
use_cached=True, | ||
max_cached_images=20, # note | ||
random_pop=False, # note | ||
pad_val=114.0), | ||
dict( | ||
type='mmdet.RandomResize', | ||
# img_scale is (width, height) | ||
scale=(img_scale[0] * 2, img_scale[1] * 2), | ||
ratio_range=(0.5, 2.0), | ||
resize_type='mmdet.Resize', | ||
keep_ratio=True), | ||
dict(type='mmdet.RandomCrop', crop_size=img_scale), | ||
dict(type='mmdet.YOLOXHSVRandomAug'), | ||
dict(type='mmdet.RandomFlip', prob=0.5), | ||
dict(type='mmdet.Pad', size=img_scale, pad_val=dict(img=(114, 114, 114))), | ||
dict( | ||
type='YOLOv5MixUp', | ||
use_cached=True, | ||
random_pop=False, | ||
max_cached_images=10, | ||
prob=0.5), | ||
dict(type='mmdet.PackDetInputs') | ||
] | ||
|
||
train_dataloader = dict(dataset=dict(pipeline=train_pipeline)) |
Oops, something went wrong.