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.

coco_detection.py 1.7 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # dataset settings
  2. dataset_type = 'CocoDataset'
  3. data_root = 'data/coco/'
  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=(512, 512), 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=(512, 512),
  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=dataset_type,
  36. ann_file=data_root + 'annotations/instances_train2017.json',
  37. img_prefix=data_root + 'train2017/',
  38. pipeline=train_pipeline),
  39. val=dict(
  40. type=dataset_type,
  41. ann_file=data_root + 'annotations/instances_val2017.json',
  42. img_prefix=data_root + 'val2017/',
  43. pipeline=test_pipeline),
  44. test=dict(
  45. type=dataset_type,
  46. ann_file=data_root + 'annotations/instances_val2017.json',
  47. img_prefix=data_root + 'val2017/',
  48. pipeline=test_pipeline))
  49. evaluation = dict(interval=5, metric='bbox')

No Description

Contributors (3)