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.

voc0712.py 1.9 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # dataset settings
  2. dataset_type = 'VOCDataset'
  3. data_root = 'data/VOCdevkit/'
  4. img_norm_cfg = dict(
  5. mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  6. train_pipeline = [
  7. dict(type='LoadImageFromFile'),
  8. dict(type='LoadAnnotations', with_bbox=True),
  9. dict(type='Resize', img_scale=(1000, 600), keep_ratio=True),
  10. dict(type='RandomFlip', flip_ratio=0.5),
  11. dict(type='Normalize', **img_norm_cfg),
  12. dict(type='Pad', size_divisor=32),
  13. dict(type='DefaultFormatBundle'),
  14. dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
  15. ]
  16. test_pipeline = [
  17. dict(type='LoadImageFromFile'),
  18. dict(
  19. type='MultiScaleFlipAug',
  20. img_scale=(1000, 600),
  21. flip=False,
  22. transforms=[
  23. dict(type='Resize', keep_ratio=True),
  24. dict(type='RandomFlip'),
  25. dict(type='Normalize', **img_norm_cfg),
  26. dict(type='Pad', size_divisor=32),
  27. dict(type='ImageToTensor', keys=['img']),
  28. dict(type='Collect', keys=['img']),
  29. ])
  30. ]
  31. data = dict(
  32. samples_per_gpu=2,
  33. workers_per_gpu=2,
  34. train=dict(
  35. type='RepeatDataset',
  36. times=3,
  37. dataset=dict(
  38. type=dataset_type,
  39. ann_file=[
  40. data_root + 'VOC2007/ImageSets/Main/trainval.txt',
  41. data_root + 'VOC2012/ImageSets/Main/trainval.txt'
  42. ],
  43. img_prefix=[data_root + 'VOC2007/', data_root + 'VOC2012/'],
  44. pipeline=train_pipeline)),
  45. val=dict(
  46. type=dataset_type,
  47. ann_file=data_root + 'VOC2007/ImageSets/Main/test.txt',
  48. img_prefix=data_root + 'VOC2007/',
  49. pipeline=test_pipeline),
  50. test=dict(
  51. type=dataset_type,
  52. ann_file=data_root + 'VOC2007/ImageSets/Main/test.txt',
  53. img_prefix=data_root + 'VOC2007/',
  54. pipeline=test_pipeline))
  55. evaluation = dict(interval=1, metric='mAP')

No Description

Contributors (1)