Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add an ionogram example in MMYOLO application #643

Merged
merged 39 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6560632
[Fix] fix the config link for rtmdet_tiny
VoyagerXvoyagerx Feb 21, 2023
8241d4c
fir the lint
VoyagerXvoyagerx Feb 22, 2023
ca4b730
merge
VoyagerXvoyagerx Mar 8, 2023
714bc06
upload configs
VoyagerXvoyagerx Mar 8, 2023
99585bd
[Docs]Add doc for application examples
VoyagerXvoyagerx Mar 8, 2023
7b15c22
[Doc] fix h1 title for ionogram_detection.md
VoyagerXvoyagerx Mar 8, 2023
35df6b5
[Fix] update doc links for project/misc/
VoyagerXvoyagerx Mar 8, 2023
bf6b839
Update links for application_examples in README
VoyagerXvoyagerx Mar 8, 2023
5f995b5
Update links for application_examples in README
VoyagerXvoyagerx Mar 8, 2023
515d38e
Fix the bad commit caused by a mistake merge.
VoyagerXvoyagerx Mar 8, 2023
82cfa7e
Merge branch 'dev' of https://github.com/open-mmlab/mmyolo into dev
VoyagerXvoyagerx Mar 8, 2023
05b48d7
Fix unnecessary modification on Table of Contents
VoyagerXvoyagerx Mar 9, 2023
c780b22
Add description of dataset preparation
VoyagerXvoyagerx Mar 9, 2023
df3dd16
Add description of dataset preparation
VoyagerXvoyagerx Mar 9, 2023
29b5c4f
Update dataset analysis and pipeline visualization
VoyagerXvoyagerx Mar 9, 2023
5842389
fix line too long
VoyagerXvoyagerx Mar 9, 2023
81906b6
Update rtmdet_s in the benchmark
VoyagerXvoyagerx Mar 9, 2023
117f5c9
fix typo in the doc
VoyagerXvoyagerx Mar 9, 2023
cbf5790
Replace local ckpt path with url
VoyagerXvoyagerx Mar 9, 2023
94a7134
Update file tree, check out for spaces
VoyagerXvoyagerx Mar 9, 2023
c408f97
Beautify configs
VoyagerXvoyagerx Mar 9, 2023
6d0fab1
Beautify configs
VoyagerXvoyagerx Mar 9, 2023
04aa040
Add introduction of annotation tool
VoyagerXvoyagerx Mar 10, 2023
f8e95df
Update rtmdet benchmark
VoyagerXvoyagerx Mar 10, 2023
d323674
Update rtmdet configs
VoyagerXvoyagerx Mar 10, 2023
185c2a1
Fix typo
VoyagerXvoyagerx Mar 10, 2023
6436694
Add English doc
VoyagerXvoyagerx Mar 10, 2023
21d8e2a
Minor revisio
VoyagerXvoyagerx Mar 10, 2023
e6afb24
Fix typo
VoyagerXvoyagerx Mar 10, 2023
53854fd
Merge branch 'dev' of https://github.com/open-mmlab/mmyolo into dev
VoyagerXvoyagerx Mar 13, 2023
2960b1e
Revision - check labels
VoyagerXvoyagerx Mar 13, 2023
d49f763
Revision - sentence structure
VoyagerXvoyagerx Mar 13, 2023
3469096
Revision - fix typo
VoyagerXvoyagerx Mar 13, 2023
a6264d8
Revision - parameters and FLOPs
VoyagerXvoyagerx Mar 13, 2023
ac78eff
Revision - replace flops with FLOPs
VoyagerXvoyagerx Mar 13, 2023
ee7716d
Revision - enhance readability
VoyagerXvoyagerx Mar 13, 2023
11e19df
Revision - fix typo
VoyagerXvoyagerx Mar 13, 2023
73b1d61
Revision - correct grammatical errors
VoyagerXvoyagerx Mar 13, 2023
4b8660e
Revision - enhance
VoyagerXvoyagerx Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ For different parts from MMDetection, we have also prepared user guides and adva
- [Visualization](docs/en/recommended_topics/visualization.md)
- [Model deployment](docs/en/recommended_topics/deploy/)
- [Troubleshooting steps](docs/en/recommended_topics/troubleshooting_steps.md)
- [MMYOLO industry examples](docs/en/recommended_topics/industry_examples.md)
- [MMYOLO application examples](docs/en/recommended_topics/application_examples/)
- [MM series repo essential basics](docs/en/recommended_topics/mm_basics.md)
- [Dataset preparation and description](docs/en/recommended_topics/dataset_preparation.md)

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ MMYOLO 用法和 MMDetection 几乎一致,所有教程都是通用的,你也
- [关于可视化的一切](docs/zh_cn/recommended_topics/visualization.md)
- [模型部署流程](docs/zh_cn/recommended_topics/deploy/)
- [常见错误排查步骤](docs/zh_cn/recommended_topics/troubleshooting_steps.md)
- [MMYOLO 产业范例介绍](docs/zh_cn/recommended_topics/industry_examples.md)
- [MMYOLO 应用范例介绍](docs/zh_cn/recommended_topics/application_examples/)
- [MM 系列 Repo 必备基础](docs/zh_cn/recommended_topics/mm_basics.md)
- [数据集准备和说明](docs/zh_cn/recommended_topics/dataset_preparation.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ You can switch between Chinese and English documents in the top-right corner of
recommended_topics/contributing.md
recommended_topics/model_design.md
recommended_topics/algorithm_descriptions/index.rst
recommended_topics/application_examples/index.rst
recommended_topics/replace_backbone.md
recommended_topics/complexity_analysis.md
recommended_topics/labeling_to_deployment_tutorials.md
recommended_topics/visualization.md
recommended_topics/deploy/index.rst
recommended_topics/troubleshooting_steps.md
recommended_topics/industry_examples.md
recommended_topics/mm_basics.md
recommended_topics/dataset_preparation.md

Expand Down
7 changes: 7 additions & 0 deletions docs/en/recommended_topics/application_examples/index.rst
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 docs/en/recommended_topics/application_examples/ionogram_detection.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/en/recommended_topics/industry_examples.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
recommended_topics/contributing.md
recommended_topics/model_design.md
recommended_topics/algorithm_descriptions/index.rst
recommended_topics/application_examples/index.rst
recommended_topics/replace_backbone.md
recommended_topics/complexity_analysis.md
recommended_topics/labeling_to_deployment_tutorials.md
recommended_topics/visualization.md
recommended_topics/deploy/index.rst
recommended_topics/troubleshooting_steps.md
recommended_topics/industry_examples.md
recommended_topics/mm_basics.md
recommended_topics/dataset_preparation.md

Expand Down
7 changes: 7 additions & 0 deletions docs/zh_cn/recommended_topics/application_examples/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MMYOLO 应用范例介绍
********************

.. toctree::
:maxdepth: 1

ionogram_detection.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/zh_cn/recommended_topics/industry_examples.md

This file was deleted.

4 changes: 2 additions & 2 deletions projects/misc/custom_dataset/README.md
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).
3 changes: 3 additions & 0 deletions projects/misc/ionogram_detection/README.md
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) 来使用。
hhaAndroid marked this conversation as resolved.
Show resolved Hide resolved

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).
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)
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)
]
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))
Loading