You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

wider_face.py 2.0 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # dataset settings
  2. dataset_type = 'WIDERFaceDataset'
  3. data_root = 'data/WIDERFace/'
  4. img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)
  5. train_pipeline = [
  6. dict(type='LoadImageFromFile', to_float32=True),
  7. dict(type='LoadAnnotations', with_bbox=True),
  8. dict(
  9. type='PhotoMetricDistortion',
  10. brightness_delta=32,
  11. contrast_range=(0.5, 1.5),
  12. saturation_range=(0.5, 1.5),
  13. hue_delta=18),
  14. dict(
  15. type='Expand',
  16. mean=img_norm_cfg['mean'],
  17. to_rgb=img_norm_cfg['to_rgb'],
  18. ratio_range=(1, 4)),
  19. dict(
  20. type='MinIoURandomCrop',
  21. min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
  22. min_crop_size=0.3),
  23. dict(type='Resize', img_scale=(300, 300), keep_ratio=False),
  24. dict(type='Normalize', **img_norm_cfg),
  25. dict(type='RandomFlip', flip_ratio=0.5),
  26. dict(type='DefaultFormatBundle'),
  27. dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
  28. ]
  29. test_pipeline = [
  30. dict(type='LoadImageFromFile'),
  31. dict(
  32. type='MultiScaleFlipAug',
  33. img_scale=(300, 300),
  34. flip=False,
  35. transforms=[
  36. dict(type='Resize', keep_ratio=False),
  37. dict(type='Normalize', **img_norm_cfg),
  38. dict(type='ImageToTensor', keys=['img']),
  39. dict(type='Collect', keys=['img']),
  40. ])
  41. ]
  42. data = dict(
  43. samples_per_gpu=60,
  44. workers_per_gpu=2,
  45. train=dict(
  46. type='RepeatDataset',
  47. times=2,
  48. dataset=dict(
  49. type=dataset_type,
  50. ann_file=data_root + 'train.txt',
  51. img_prefix=data_root + 'WIDER_train/',
  52. min_size=17,
  53. pipeline=train_pipeline)),
  54. val=dict(
  55. type=dataset_type,
  56. ann_file=data_root + 'val.txt',
  57. img_prefix=data_root + 'WIDER_val/',
  58. pipeline=test_pipeline),
  59. test=dict(
  60. type=dataset_type,
  61. ann_file=data_root + 'val.txt',
  62. img_prefix=data_root + 'WIDER_val/',
  63. pipeline=test_pipeline))

No Description

Contributors (3)