Detectron2: how to make full use of data augmentation

Created on 14 Dec 2019  ·  5Comments  ·  Source: facebookresearch/detectron2

❓ How to use Detectron2

hello team, Can you answer one queation for a novice:

  1. what's the parameter format for data augmentation function in 'config.yaml '. I can only find :
    '''
    INPUT:
    CROP:
    ENABLED: false
    SIZE:

    • 0.9

    • 0.9

      TYPE: relative_range

      FORMAT: BGR

      MASK_FORMAT: polygon

      MAX_SIZE_TEST: 1333

      MAX_SIZE_TRAIN: 1333

      MIN_SIZE_TEST: 800

      MIN_SIZE_TRAIN:

    • 640

    • 672

    • 704

    • 736

    • 768

    • 800

      MIN_SIZE_TRAIN_SAMPLING: choice

      ...

      '''

      but, I find some other function in "transform_gen.py"

      '''

"RandomBrightness",

24 | "RandomContrast",
25 | "RandomCrop",
26 | "RandomExtent",
27 | "RandomFlip",
28 | "RandomSaturation"
'''

Most helpful comment

https://detectron2.readthedocs.io/tutorials/data_loading.html explains how to use your own data loader. You need a custom data mapping function to add new augmentations.
One example of such customization is in https://github.com/facebookresearch/detectron2/blob/22b70a8078eb09da38d0fefa130d0f537562bebc/projects/DensePose/train_net.py#L37-L38

All 5 comments

> "RandomBrightness",

24 | "RandomContrast",
25 | "RandomCrop",
26 | "RandomExtent",
27 | "RandomFlip",
28 | "RandomSaturation"

These are augmentation utilities you can call if you use your custom data loader.

"RandomBrightness",

24 | "RandomContrast",
25 | "RandomCrop",
26 | "RandomExtent",
27 | "RandomFlip",
28 | "RandomSaturation"

These are augmentation utilities you can call if you use your custom data loader.

Thank you for your kind reply.
Do you mean I need to comprehend the whole project and modify the code to build my own data loader.
Is there any interfaces or guidance.

In some cases, data augmentation also not works.
For example, the training and validation set from the new style map based dataset have some don't care area, but you have not masked this area manually.
It is the duty of the dataset user(me) to mask this don't care area which may
have lots of unannotated objects before training.

AaronXinWu notifications@github.com 于2019年12月14日周六 下午4:59写道:

"RandomBrightness",

24 | "RandomContrast",
25 | "RandomCrop",
26 | "RandomExtent",
27 | "RandomFlip",
28 | "RandomSaturation"

These are augmentation utilities you can call if you use your custom data
loader.

Thank you for your kind reply.
Do you mean I need to comprehend the whole project and modify the code to
build my own data loader.
Is there any interfaces or guidance.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/facebookresearch/detectron2/issues/527?email_source=notifications&email_token=AD2E4TF3O4EPNISRQNQ6I5DQYSN53A5CNFSM4J2Y5FS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG357SA#issuecomment-565698504,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AD2E4TE3W4S6A7GM36BAZCDQYSN53ANCNFSM4J2Y5FSQ
.

https://detectron2.readthedocs.io/tutorials/data_loading.html explains how to use your own data loader. You need a custom data mapping function to add new augmentations.
One example of such customization is in https://github.com/facebookresearch/detectron2/blob/22b70a8078eb09da38d0fefa130d0f537562bebc/projects/DensePose/train_net.py#L37-L38

thank you for your support!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ormagardskvaedi picture Ormagardskvaedi  ·  4Comments

ChungNPH picture ChungNPH  ·  3Comments

jinfagang picture jinfagang  ·  3Comments

limsijie93 picture limsijie93  ·  3Comments

danielgordon10 picture danielgordon10  ·  3Comments