Doraemon-AI commited on
Commit
5e48cbc
1 Parent(s): 685e592
Files changed (1) hide show
  1. README.md +165 -0
README.md CHANGED
@@ -1,3 +1,168 @@
1
  ---
2
  license: afl-3.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: afl-3.0
3
  ---
4
+ # pdf-layout-chinese: A Chinese document layout PDF dataset
5
+
6
+ ### 介绍
7
+
8
+ pdf-layout-chinese是一个中文文档版面分析数据集,面向中文文献类(论文)场景。包含以下10个label:
9
+
10
+ | 正文 | 标题 | 图片 | 图片标题 | 表格 | 表格标题 | 页眉 | 页脚 | 注释 | 公式 |
11
+ | :----: | :-----: | :------: | :--------------: | :-----: | :-------------: | :------: | :------: | :---------: | :--------: |
12
+ | Text | Title | Figure | Figure caption | Table | Table caption | Header | Footer | Reference | Equation |
13
+
14
+ 共包含5000张训练集和1000张验证集,分别在train和val目录下。每张图片对应一个同名的标注文件(.json)。
15
+
16
+ 样例展示:
17
+
18
+ ![1](https://cdn-lfs-us-1.huggingface.co/repos/68/a0/68a093e9abcb0e5fc9842c05f7c3aefe036afedd88fa0f7e2e414f21f8d515c5/d776fada24e3b6b2482d0b4041fbf9b6089c4a8acb586737378136561e131cbf?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27show_1.png%3B+filename%3D%22show_1.png%22%3B&response-content-type=image%2Fpng&Expires=1713690252&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxMzY5MDI1Mn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzY4L2EwLzY4YTA5M2U5YWJjYjBlNWZjOTg0MmMwNWY3YzNhZWZlMDM2YWZlZGQ4OGZhMGY3ZTJlNDE0ZjIxZjhkNTE1YzUvZDc3NmZhZGEyNGUzYjZiMjQ4MmQwYjQwNDFmYmY5YjYwODljNGE4YWNiNTg2NzM3Mzc4MTM2NTYxZTEzMWNiZj9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoifV19&Signature=HwGysVyURdVxBYnmy0XSARNO3-Ew0FVjQ1LbkBbJDyj5NAPhZUglUSVqxfgeZiP%7E%7EYIx6a6BK%7EQURuhThrnKQa%7EV0rK34AGw0i4pOePXZQLj-dps3U51OCR30IDqnvldRjOkjs4UzEVFjV5Us4Uy7kIn0yQfeaVxdiXZQFedH%7E%7EEJ7GMaH43ckTbWPUKlEcBkqEuHZ7TquMvC8sdLmxhoZxOlpwFl2KNsH8lJmQXv6Zz8BzWq6wk9pTuF%7E%7ECSz1m6Ao7fVDrk5Snn%7ECY8nxgo34N9ykWkYFlho03rqLX406YY3h7gsZ2ptyUm7kVzYtpzOI0BzmeGUiDyIOl%7EdG6xQ__&Key-Pair-Id=KCD77M1F0VK2B)
19
+ ![2](https://cdn-lfs-us-1.huggingface.co/repos/68/a0/68a093e9abcb0e5fc9842c05f7c3aefe036afedd88fa0f7e2e414f21f8d515c5/95b9cc1f8f785cb52095f1f799e1af682047ec8073b8d650efd673bb683cfdec?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27show_2.png%3B+filename%3D%22show_2.png%22%3B&response-content-type=image%2Fpng&Expires=1713690280&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxMzY5MDI4MH19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzY4L2EwLzY4YTA5M2U5YWJjYjBlNWZjOTg0MmMwNWY3YzNhZWZlMDM2YWZlZGQ4OGZhMGY3ZTJlNDE0ZjIxZjhkNTE1YzUvOTViOWNjMWY4Zjc4NWNiNTIwOTVmMWY3OTllMWFmNjgyMDQ3ZWM4MDczYjhkNjUwZWZkNjczYmI2ODNjZmRlYz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoifV19&Signature=JuEZ0GrxIHnxMDAgDxYxIKDUXwNxPspVs5tUF6qoDRlvuoi7jkrzFSSa%7EUgEPMR29iTWX3serSkLO3pTBEEt5ftMwWhdopWBp2FULipfBms4qQQ2oabn--lR26UC9s5jdqXjWXaNm3DvuUplxDxnOj6541RgClZm64bY-YHYa-Pb3T0xiKqM8-JoBKRSls1Vr8ijZFfxM%7EJJAwTZh3el7AG5t7jLlpWeHAeUQs-g-hJ2iIyDHziYKQg1OnIfEBpKV270kKK%7EPDniXsikvKJsDInYFDFrH1BUqxx9PFJQiqfrqWlqXWsE4MCKoxkhm0%7EXmWTF9ZuwfKbon5Bs-DoAwA__&Key-Pair-Id=KCD77M1F0VK2B)
20
+
21
+ ### 标注格式
22
+
23
+ 我们的标注工具是labelme,所以标注格式和labelme格式一致。这里说明一下比较重要的字段。
24
+
25
+ "shapes": shapes字段是一个list,里面有多个dict,每个dict代表一个标注实例。
26
+
27
+ "labels": 类别。
28
+
29
+ "points": 实例标注。因为我们的标注是Polygon形式,所以points里的坐标数量可能大于4。
30
+
31
+ "shape_type": "polygon"
32
+
33
+ "imagePath": 图片路径/名
34
+
35
+ "imageHeight": 高
36
+
37
+ "imageWidth": 宽
38
+
39
+ 展示一个完整的标注样例:
40
+
41
+ ```
42
+ {
43
+ "version":"4.5.6",
44
+ "flags":{},
45
+ "shapes":[
46
+ {
47
+ "label":"Title",
48
+ "points":[
49
+ [
50
+ 553.1111111111111,
51
+ 166.59259259259258
52
+ ],
53
+ [
54
+ 553.1111111111111,
55
+ 198.59259259259258
56
+ ],
57
+ [
58
+ 686.1111111111111,
59
+ 198.59259259259258
60
+ ],
61
+ [
62
+ 686.1111111111111,
63
+ 166.59259259259258
64
+ ]
65
+ ],
66
+ "group_id":null,
67
+ "shape_type":"polygon",
68
+ "flags":{}
69
+ },
70
+ {
71
+ "label":"Text",
72
+ "points":[
73
+ [
74
+ 250.5925925925925,
75
+ 298.0740740740741
76
+ ],
77
+ [
78
+ 250.5925925925925,
79
+ 345.0740740740741
80
+ ],
81
+ [
82
+ 188.5925925925925,
83
+ 345.0740740740741
84
+ ],
85
+ [
86
+ 188.5925925925925,
87
+ 410.0740740740741
88
+ ],
89
+ [
90
+ 188.5925925925925,
91
+ 456.0740740740741
92
+ ],
93
+ [
94
+ 324.5925925925925,
95
+ 456.0740740740741
96
+ ],
97
+ [
98
+ 324.5925925925925,
99
+ 410.0740740740741
100
+ ],
101
+ [
102
+ 1051.5925925925926,
103
+ 410.0740740740741
104
+ ],
105
+ [
106
+ 1051.5925925925926,
107
+ 345.0740740740741
108
+ ],
109
+ [
110
+ 1052.5925925925926,
111
+ 345.0740740740741
112
+ ],
113
+ [
114
+ 1052.5925925925926,
115
+ 298.0740740740741
116
+ ]
117
+ ],
118
+ "group_id":null,
119
+ "shape_type":"polygon",
120
+ "flags":{}
121
+ },
122
+ {
123
+ "label":"Footer",
124
+ "points":[
125
+ [
126
+ 1033.7407407407406,
127
+ 1634.5185185185185
128
+ ],
129
+ [
130
+ 1033.7407407407406,
131
+ 1646.5185185185185
132
+ ],
133
+ [
134
+ 1052.7407407407406,
135
+ 1646.5185185185185
136
+ ],
137
+ [
138
+ 1052.7407407407406,
139
+ 1634.5185185185185
140
+ ]
141
+ ],
142
+ "group_id":null,
143
+ "shape_type":"polygon",
144
+ "flags":{}
145
+ }
146
+ ],
147
+ "imagePath":"val_0031.jpg",
148
+ "imageData":null,
149
+ "imageHeight":1754,
150
+ "imageWidth":1240
151
+ }
152
+ ```
153
+
154
+ ### 转coco格式
155
+
156
+ 执行命令:
157
+
158
+ ```
159
+ # train
160
+ python3 labelme2coco.py train train_save_path --labels labels.txt
161
+
162
+ # val
163
+ python3 labelme2coco.py val val_save_path --labels labels.txt
164
+ ```
165
+
166
+ 转换结果保存在train_save_path/val_save_path目录下。
167
+
168
+ labelme2coco.py取自labelme,更多信息请参考[labelme官方项目](https://github.com/wkentaro/labelme/tree/master/examples/instance_segmentation)