forked from cm107/annotation_utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataset_collection_config_from_scratch.py
69 lines (65 loc) · 1.87 KB
/
dataset_collection_config_from_scratch.py
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
from annotation_utils.dataset.config import \
DatasetConfigCollectionHandler, DatasetConfigCollection, DatasetConfig
handler = DatasetConfigCollectionHandler()
handler.append(
DatasetConfigCollection(
[
DatasetConfig(
img_dir='/a/b/c/d/img',
ann_path='/a/b/ann/path.json',
ann_format='coco'
),
DatasetConfig(
img_dir='/a/b/c/d/e/f/img',
ann_path='/a/b/c/d/e/ann_folder/output.json',
ann_format='custom'
),
DatasetConfig(
img_dir='/a/b/c/D/img',
ann_path='/a/b/c/D/img/output.json'
)
]
)
)
handler.append(
DatasetConfigCollection(
[
DatasetConfig(
img_dir='/x/y/a/img',
ann_path='/x/y/a/ann/output.json',
ann_format='coco'
),
DatasetConfig(
img_dir='/x/y/b/img',
ann_path='/x/y/b/ann/output.json',
ann_format='coco'
),
DatasetConfig(
img_dir='/x/y/c/img',
ann_path='/x/y/c/ann/output.json',
ann_format='coco'
),
]
)
)
handler.append(
DatasetConfigCollection(
[
DatasetConfig(
img_dir='/A/B/C/D/E/F/G/img',
ann_path='/A/B/ann/path.json',
ann_format='coco'
),
DatasetConfig(
img_dir='/A/B/C/D/E/F/img',
ann_path='/A/B/C/D/E/ann_folder/output.json',
ann_format='custom'
),
DatasetConfig(
img_dir='/A/B/C/D/E/img',
ann_path='/A/B/C/D/E/img/output.json'
)
]
)
)
handler.save_to_path('scratch_config.yaml', overwrite=True)