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

About multiscale training #78

Closed
iceload123 opened this issue Oct 25, 2018 · 4 comments
Closed

About multiscale training #78

iceload123 opened this issue Oct 25, 2018 · 4 comments

Comments

@iceload123
Copy link

I found that the repo has already supported using different image scales in the training.
This should be included in data augmentation, then what does multiscale training mean?
I think multiscale training should has similar format to input image pyramid, which has not been supported by this repo yet?

@hellock
Copy link
Member

hellock commented Oct 25, 2018

You only need to modify the data.train.img_scale field in the config file.
For example, you can use a list of scales [(1333, 800), (1666, 1000)] so that each image will randomly select a scale between (1333, 800) and (1666, 1000).

data = dict(
    imgs_per_gpu=2,
    workers_per_gpu=2,
    train=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_train2017.json',
        img_prefix=data_root + 'train2017/',
        img_scale=[(1333, 800), (1666, 1000)],
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0.5,
        with_mask=True,
        with_crowd=True,
        with_label=True),
    val=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_val2017.json',
        img_prefix=data_root + 'val2017/',
        img_scale=(1333, 800),
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0,
        with_mask=True,
        with_crowd=True,
        with_label=True),
    test=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_val2017.json',
        img_prefix=data_root + 'val2017/',
        img_scale=(1333, 800),
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0,
        with_mask=False,
        with_label=False,
        test_mode=True))

@iceload123
Copy link
Author

You only need to modify the data.train.img_scale field in the config file.
For example, you can use a list of scales [(1333, 800), (1666, 1000)] so that each image will randomly select a scale between (1333, 800) and (1666, 1000).

data = dict(
    imgs_per_gpu=2,
    workers_per_gpu=2,
    train=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_train2017.json',
        img_prefix=data_root + 'train2017/',
        img_scale=[(1333, 800), (1666, 1000)],
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0.5,
        with_mask=True,
        with_crowd=True,
        with_label=True),
    val=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_val2017.json',
        img_prefix=data_root + 'val2017/',
        img_scale=(1333, 800),
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0,
        with_mask=True,
        with_crowd=True,
        with_label=True),
    test=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_val2017.json',
        img_prefix=data_root + 'val2017/',
        img_scale=(1333, 800),
        img_norm_cfg=img_norm_cfg,
        size_divisor=32,
        flip_ratio=0,
        with_mask=False,
        with_label=False,
        test_mode=True))

Thanks, but my question is "what does multiscale training means".
I am not sure if simply selecting different resize scale in training phase can be called multiscale training. I notice that in your poster, almost 2% mAP is gained by multiscale training, but simply setting training scale to [(1667,1000),(1333,800),(1000,600)] brings no benefits according to my experiments.

@hellock
Copy link
Member

hellock commented Oct 25, 2018

The term of "multiscale training" is adopted in many papers, which indicates resizing images to different scales at each iteration. In the challenge, we use the setting [(400, 1600), (1400, 1600)] which means the short edge are randomly sampled from 400~1400, and the long edge is fixed as 1600.

@iceload123
Copy link
Author

The term of "multiscale training" is adopted in many papers, which indicates resizing images to different scales at each iteration. In the challenge, we use the setting [(400, 1600), (1400, 1600)] which means the short edge are randomly sampled from 400~1400, and the long edge is fixed as 1600.

Thanks.

CjayBillones pushed a commit to CjayBillones/mmdetection that referenced this issue Feb 18, 2021
FANGAreNotGnu pushed a commit to FANGAreNotGnu/mmdetection that referenced this issue Oct 23, 2023
* [Tutorial Branch PR] add yolo detector for demo (open-mmlab#72)

* patch

* version

* rm unsafe use

* rm unsafe use

* feat: obejct detection, init

* [demo] add yolo detector

* run successfully

* [fix] root path, add necessary files

* [fix] remove deprecated files, and

* [doc] object detection, part 1

* [Doc] object detection, part 2

* [fix] remove unnecessary lines

* [demo] change demo image

* [fix] dependent module, name of tiny_motorbike

* Trigger CI

* [doc] fix ag.Categorical

* Trigger CI

* modify Jenkin

* remove pandas

* [docs] add cards, fix typos

* [Jenkin] change back

* [ name] classifier -> detector

* [feat] add tqdm

* [tqdm] show bar

* [docs] add index.rst for object_detection

* [docs] correct link to beginner.html, moving detection cards

* torch tutorial (open-mmlab#71)

* [Tutorial Branch PR] Tutorial patch (open-mmlab#73)

* patch

* version

* rm unsafe use

* rm unsafe use

* fix rl searcher update

* dataset wip

* macos dataloader without using mx-opencv

* data sampler and misc

* rm

* [Tutorial Branch PR] Modifications on docs (open-mmlab#78)

* docs: retouch the tutorial of object detection

* docs: correct links to tutorials of image classification

* Trigger CI

* [Tutorial Branch PR] Patch-1 (open-mmlab#77)

* tutorial content for wednesday

* logger info

* patch+

* add files

* tutorial updates

* patch +1

* misc doc improvement

* reduce time

* ci

* comments

* warning and lazy import

* lightgbm exception handling for macos

* cut pytorch nas for now

* warnings and miscs

* te

* split seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants