File size: 2,038 Bytes
24c4def
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
data_root = 'data/funsd'
cache_path = 'data/cache'

train_preparer = dict(
    obtainer=dict(
        type='NaiveDataObtainer',
        cache_path=cache_path,
        data_root=data_root,
        files=[
            dict(
                url='https://guillaumejaume.github.io/FUNSD/dataset.zip',
                save_name='funsd.zip',
                md5='e05de47de238aa343bf55d8807d659a9',
                content=['image', 'annotation'],
                mapping=[
                    [
                        'funsd/dataset/training_data/images',
                        'textdet_imgs/train'
                    ],
                    [
                        'funsd/dataset/training_data/annotations',
                        'annotations/train'
                    ],
                ]),
        ]),
    gatherer=dict(
        type='PairGatherer',
        img_suffixes=['.png'],
        rule=[r'(\w+)\.png', r'\1.json']),
    parser=dict(type='FUNSDTextDetAnnParser'),
    packer=dict(type='TextDetPacker'),
    dumper=dict(type='JsonDumper'),
)

test_preparer = dict(
    obtainer=dict(
        type='NaiveDataObtainer',
        cache_path=cache_path,
        files=[
            dict(
                url='https://guillaumejaume.github.io/FUNSD/dataset.zip',
                save_name='funsd.zip',
                md5='e05de47de238aa343bf55d8807d659a9',
                content=['image', 'annotation'],
                mapping=[
                    ['funsd/dataset/testing_data/images', 'textdet_imgs/test'],
                    [
                        'funsd/dataset/testing_data/annotations',
                        'annotations/test'
                    ],
                ]),
        ]),
    gatherer=dict(
        type='PairGatherer',
        img_suffixes=['.png'],
        rule=[r'(\w+)\.png', r'\1.json']),
    parser=dict(type='FUNSDTextDetAnnParser'),
    packer=dict(type='TextDetPacker'),
    dumper=dict(type='JsonDumper'),
)
delete = ['annotations', 'funsd']
config_generator = dict(type='TextDetConfigGenerator')