open_dataset.yaml 2.26 KB
Newer Older
sunxx1's avatar
sunxx1 committed
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: DBNet
dataset:
  train:
    dataset:
      type: DetDataset # 数据集类型
      args:
        data_path: # 一个存放 img_path \t gt_path的文件
          - ''
        pre_processes: # 数据的预处理过程,包含augment和标签制作
          - type: IaaAugment # 使用imgaug进行变换
            args:
              - {'type':Fliplr, 'args':{'p':0.5}}
              - {'type': Affine, 'args':{'rotate':[-10,10]}}
              - {'type':Resize,'args':{'size':[0.5,3]}}
          - type: EastRandomCropData
            args:
              size: [640,640]
              max_tries: 50
              keep_ratio: true
          - type: MakeBorderMap
            args:
              shrink_ratio: 0.4
              thresh_min: 0.3
              thresh_max: 0.7
          - type: MakeShrinkMap
            args:
              shrink_ratio: 0.4
              min_text_size: 8
        transforms: # 对图片进行的变换方式
          - type: ToTensor
            args: {}
          - type: Normalize
            args:
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
        img_mode: RGB
        load_char_annotation: false
        expand_one_char: false
        filter_keys: [img_path,img_name,text_polys,texts,ignore_tags,shape] # 返回数据之前,从数据字典里删除的key
        ignore_tags: ['*', '###']
    loader:
      batch_size: 1
      shuffle: true
      pin_memory: false
      num_workers: 0
      collate_fn: ''
  validate:
    dataset:
      type: DetDataset
      args:
        data_path:
          - ''
        pre_processes:
          - type: ResizeShortSize
            args:
              short_size: 736
              resize_text_polys: false
        transforms:
          - type: ToTensor
            args: {}
          - type: Normalize
            args:
              mean: [0.485, 0.456, 0.406]
              std: [0.229, 0.224, 0.225]
        img_mode: RGB
        load_char_annotation: false # 是否加载字符级标注
        expand_one_char: false # 是否对只有一个字符的框进行宽度扩充,扩充后w = w+h
        filter_keys: []
        ignore_tags: ['*', '###']
    loader:
      batch_size: 1
      shuffle: true
      pin_memory: false
      num_workers: 0
      collate_fn: ICDARCollectFN