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

fix mosaic and autoaug #8533

Open
wants to merge 2 commits into
base: release/2.6
Choose a base branch
from

Conversation

GuoQuanhao
Copy link

#8517
本次修改并测试的算子包括operators.py中的Mosaic,RandomDistort,AutoAugment
autoaugment_utils.py中的policy_v3,其中带only的算子例如TranslateY_Only_BBoxes,ShearY_Only_BBoxes并未纳入本次训练进程的测试中

修改完成的数据增强,通过双3090在COCO数据集通过picodet训练10个epoch得到如下精度
截图 2023-08-13 11-55-08
其中数据读取yml文件如下

worker_num: 0
eval_height: &eval_height 640
eval_width: &eval_width 640
eval_size: &eval_size [*eval_height, *eval_width]

TrainReader:
  sample_transforms:
  - Decode: {}
  - Mosaic:
      prob: 1.0
      input_dim: [640, 640]
      degrees: [-10, 10]
      scale: [0.5, 1.5]
      shear: [-0.5, 0.5]
      translate: [-0.1, 0.1]
      enable_mixup: True
  - AutoAugment: {autoaug_type: 'v3'}
  - DebugVisibleImage: {output_dir: '../debug'}
  batch_transforms:
  - BatchRandomResize: {target_size: [576, 608, 640, 672, 704], random_size: True, random_interp: True, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  - PadGT: {}
  batch_size: 32
  shuffle: true
  mosaic_epoch: 10
  drop_last: true


EvalReader:
  sample_transforms:
  - Decode: {}
  - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  batch_transforms:
  - PadBatch: {pad_to_stride: 32}
  batch_size: 8
  shuffle: false


TestReader:
  inputs_def:
    image_shape: [1, 3, *eval_height, *eval_width]
  sample_transforms:
  - Decode: {}
  - Resize: {interp: 2, target_size: *eval_size, keep_ratio: False}
  - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
  - Permute: {}
  batch_size: 1

@paddle-bot
Copy link

paddle-bot bot commented Aug 13, 2023

Thanks for your contribution!

@GuoQuanhao
Copy link
Author

这里给出了一些训练过程中的数据增强,其数据增强方案见上个comment的yml文件
链接:https://pan.baidu.com/s/1LNGuYzobeQdCEkzdjZ_RJQ
提取码:ayb2
--来自百度网盘超级会员V5的分享

@GuoQuanhao
Copy link
Author

hello,这边有测试完成吗,我看这个pr很久啦

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

Successfully merging this pull request may close these issues.

None yet

4 participants