Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

voc0712.py 1.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  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')
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...