wqzh commited on
Commit
83cb102
·
verified ·
1 Parent(s): 02a69b2

Upload 114 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +32 -3
  2. README_ZH.md +34 -0
  3. images-crops-concat/test-00000_p1.png +3 -0
  4. images-crops-concat/test-00000_p2.png +3 -0
  5. images-crops-concat/test-00001_p1.png +3 -0
  6. images-crops-concat/test-00001_p2.png +3 -0
  7. images-crops-concat/test-00002_p1.png +3 -0
  8. images-crops-concat/test-00002_p2.png +3 -0
  9. images-crops-concat/test-00003_p1.png +3 -0
  10. images-crops-concat/test-00003_p2.png +3 -0
  11. images-crops-concat/test-00004_p1.png +3 -0
  12. images-crops-concat/test-00004_p2.png +3 -0
  13. images-crops-concat/test-00004_p3.png +3 -0
  14. images-crops-concat/test-00005_p1.png +3 -0
  15. images-crops-concat/test-00005_p2.png +3 -0
  16. images-crops-concat/train-00000_p1.png +3 -0
  17. images-crops-concat/train-00000_p2.png +3 -0
  18. images-crops-concat/train-00003_p1.png +3 -0
  19. images-crops-concat/train-00003_p2.png +3 -0
  20. images-crops-concat/train-00005_p1.png +3 -0
  21. images-crops-concat/train-00005_p2.png +3 -0
  22. images-crops-concat/train-00006_p1.png +3 -0
  23. images-crops-concat/train-00006_p2.png +3 -0
  24. images-crops-concat/train-00009_p1.png +3 -0
  25. images-crops-concat/train-00009_p2.png +3 -0
  26. images-crops-concat/train-00010_p1.png +3 -0
  27. images-crops-concat/train-00010_p2.png +3 -0
  28. images-crops-concat/train-00012_p1.png +3 -0
  29. images-crops-concat/train-00012_p2.png +3 -0
  30. images-crops-concat/train-00015_p1.png +3 -0
  31. images-crops-concat/train-00015_p2.png +3 -0
  32. images-crops-concat/train-00018_p1.png +3 -0
  33. images-crops-concat/train-00018_p2.png +3 -0
  34. images-crops-concat/train-00020_p1.png +3 -0
  35. images-crops-concat/train-00020_p2.png +3 -0
  36. images-crops-concat/train-00021_p1.png +3 -0
  37. images-crops-concat/train-00021_p2.png +3 -0
  38. images-crops-concat/train-00024_p1.png +3 -0
  39. images-crops-concat/train-00024_p2.png +3 -0
  40. images-crops-concat/train-00025_p1.png +3 -0
  41. images-crops-concat/train-00025_p2.png +3 -0
  42. images-crops-concat/train-00027_p1.png +3 -0
  43. images-crops-concat/train-00027_p2.png +3 -0
  44. images-crops-concat/train-00030_p1.png +3 -0
  45. images-crops-concat/train-00030_p2.png +3 -0
  46. images-crops-concat/train-00033_p1.png +3 -0
  47. images-crops-concat/train-00033_p2.png +3 -0
  48. images-crops-concat/train-00033_p3.png +3 -0
  49. images-crops-concat/train-00035_p1.png +3 -0
  50. images-crops-concat/train-00035_p2.png +3 -0
README.md CHANGED
@@ -1,3 +1,32 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center">
2
+ <a href="README.md">English</a> | <a href="README_ZH.md">中文</a>
3
+ </p>
4
+
5
+ # Introduction
6
+ The original images of this dataset are from [DocLayNet-v1.2](https://huggingface.co/datasets/docling-project/DocLayNet-v1.2). You can run `src/1_save_img_from_parquet.py` to convert the parquet files into images.
7
+
8
+ # Page Number Cropping
9
+ This dataset uses the `yolo11-medium-page-best-quant-ir9.onnx` weights from [Here](https://huggingface.co/wqzh/DocLayout-PageNumDet/tree/main/models) to detect page number bounding boxes from the images obtained above, and then crop out the page number regions (detection errors may exist, as no post-processing was applied by the author).
10
+
11
+ The cropped images are saved in the `images-crops` directory, and the detection results are saved in the `images-labels` directory. The author added a constraint: the YOLO-format label file is only saved when exactly one page number box is detected, while crops of all detected boxes are retained. Therefore, the number of files in `images-crops` is greater than that in `images-labels`.
12
+
13
+ You can run `src/2_det_onnx_wo_opencv_cuda.py` to detect page numbers, crop images, and save label files.
14
+
15
+ ```shell
16
+ find images-labels -type f -name "*.txt" | wc -l
17
+ find images-crops -type f -name "*.jpg" | wc -l
18
+ ```
19
+ - Number of `.txt` files in `images-labels`: 15902
20
+ - Number of `.jpg` files in `images-crops`: 17203
21
+
22
+ # Page Number Concatenation
23
+ `src/3_concat_crops_by_pages.py` concatenates all cropped images from `images-crops` and saves them in the `images-crops-concat` directory, so you can preview the entire dataset.
24
+
25
+ Example
26
+ <img src="images-crops-concat/train-00005_p1.png" width="500">
27
+
28
+ Note: If you intend to use the label files from this dataset, they need to be cleaned separately.
29
+
30
+ # Page Number Coordinate Distribution
31
+ `src/4_visualize_yolo_txt_distribution.py` visualizes the distribution of bounding box centers from all label files in `images-labels`.
32
+ <img src="yolo_centers_distribution.png" width="500">
README_ZH.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center">
2
+ <a href="README_ZH.md">中文</a> | <a href="README.md">English</a>
3
+ </p>
4
+
5
+ # 简介
6
+ 本数据集的原始图片来源于[DocLayNet-v1.2](https://huggingface.co/datasets/docling-project/DocLayNet-v1.2)。 可以运行`src/1_save_img_from_parquet.py` 把parquet文件转换成图片。
7
+
8
+ # 裁剪页码
9
+ 本数据集使用[Here](https://huggingface.co/wqzh/DocLayout-PageNumDet/tree/main/models)的`yolo11-medium-page-best-quant-ir9.onnx`权重,从上一步得到的图像中提取出页码的坐标,并裁剪出页码图片(检测可能存在错误,作者没有做任何后处理)。
10
+
11
+ 裁剪图片保存在`images-crops`目录下,检测的结果保存在`images-labels`目录下。作者做了一个限制:只有检测的页码框数量为1的时候,才会保存txt格式的标注文件,而检测的所有页码框的截图会全部保留。因此,`images-crops`目录下的文件数量 会大于 `images-labels`目录下的文件数量。
12
+
13
+ 可以运行`src/2_det_onnx_wo_opencv_cuda.py` 检测图片,裁剪图片,保存标注文件。
14
+
15
+ ```shell
16
+ find images-labels -type f -name "*.txt" | wc -l
17
+ find images-crops -type f -name "*.jpg" | wc -l
18
+ ```
19
+ - images-labels 目录下 .txt 文件数: 15902
20
+ - images-crops 目录下 .jpg 文件数: 17203
21
+
22
+ # 页码合并
23
+ `src/3_concat_crops_by_pages.py`将`images-crops`下所有的图片进行合并,并保存在`images-crops-concat`目录下。因此你可以预览整个数据集。
24
+
25
+ 示例
26
+ <img src="images-crops-concat/train-00005_p1.png" width="500">
27
+
28
+ 注意:如果要使用这个数据集的label文件,需要单独清洗。
29
+
30
+ # 页码坐标分布
31
+ `src/4_visualize_yolo_txt_distribution.py`将`images-labels`下所有的标注文件的坐标分布可视化。
32
+ <img src="yolo_centers_distribution.png" width="500">
33
+
34
+
images-crops-concat/test-00000_p1.png ADDED

Git LFS Details

  • SHA256: 38cef85adc39d37183c6b457f280ff17ee7d173fda98865d93ae95035bf479f1
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
images-crops-concat/test-00000_p2.png ADDED

Git LFS Details

  • SHA256: 18c929a173f5106f21e1f39ede60eee4327f391a052890000a6a690cc32f52aa
  • Pointer size: 130 Bytes
  • Size of remote file: 42 kB
images-crops-concat/test-00001_p1.png ADDED

Git LFS Details

  • SHA256: 54967e15edf8bd1b353383cc228fc1cdccba2f2e38cec13145e9134750df1147
  • Pointer size: 131 Bytes
  • Size of remote file: 270 kB
images-crops-concat/test-00001_p2.png ADDED

Git LFS Details

  • SHA256: 4c115955eb58b0b0a4f1e8a72d4e6fad50bde9a1657ea5ed126c40b68acf3d6c
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
images-crops-concat/test-00002_p1.png ADDED

Git LFS Details

  • SHA256: e55d553bf5b3c1a19fd4771b67bd1ba80babde7bfb16d9303c43b348c42ea232
  • Pointer size: 131 Bytes
  • Size of remote file: 124 kB
images-crops-concat/test-00002_p2.png ADDED

Git LFS Details

  • SHA256: 16dd688b2b7a3b818a6b47de7e369b7f92b9919b0cf377a3e8bfb0362bc79d45
  • Pointer size: 130 Bytes
  • Size of remote file: 80.9 kB
images-crops-concat/test-00003_p1.png ADDED

Git LFS Details

  • SHA256: e068222b86dab96691fda6c99241b946a38827ff779118ea97167512eaa4d6db
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
images-crops-concat/test-00003_p2.png ADDED

Git LFS Details

  • SHA256: 6b2e03875c54a3b689c4abecf874565f6df4d868fd601da139190175aa07f41d
  • Pointer size: 131 Bytes
  • Size of remote file: 130 kB
images-crops-concat/test-00004_p1.png ADDED

Git LFS Details

  • SHA256: 8e653de1dc628928746a598a4d4fbfd67cd814a59275fb3cb528be07644d57e0
  • Pointer size: 131 Bytes
  • Size of remote file: 191 kB
images-crops-concat/test-00004_p2.png ADDED

Git LFS Details

  • SHA256: 363c331291e57cf12f581bc9c3cd4db893fb0cc24af584e89f3dfd5d8565218c
  • Pointer size: 131 Bytes
  • Size of remote file: 227 kB
images-crops-concat/test-00004_p3.png ADDED

Git LFS Details

  • SHA256: 35958f52fe22a7ba5e75d5a6f9532c05a964c83a9849c7e36f23c38d3fa9a6e0
  • Pointer size: 130 Bytes
  • Size of remote file: 44.1 kB
images-crops-concat/test-00005_p1.png ADDED

Git LFS Details

  • SHA256: 504a6f145e4059c57c35228dc671b9bc65dbdaf4dc115373035058f80b9d0d4d
  • Pointer size: 131 Bytes
  • Size of remote file: 197 kB
images-crops-concat/test-00005_p2.png ADDED

Git LFS Details

  • SHA256: 346e6d5f8a970c8c26e5ddf6aca6107d2898e01b3abae35ea9e139f848180d4b
  • Pointer size: 130 Bytes
  • Size of remote file: 42.9 kB
images-crops-concat/train-00000_p1.png ADDED

Git LFS Details

  • SHA256: c2688f9679575ca2e9200ce7a6a15b126d25929e12bf5d1c1f00f61c317b49ea
  • Pointer size: 131 Bytes
  • Size of remote file: 243 kB
images-crops-concat/train-00000_p2.png ADDED

Git LFS Details

  • SHA256: ede86dcc35c2c4affd988c1f768f3a5ad6fbe907947f57773b948ac7e090a984
  • Pointer size: 130 Bytes
  • Size of remote file: 45.9 kB
images-crops-concat/train-00003_p1.png ADDED

Git LFS Details

  • SHA256: 6120e1ee1099de09f0f53eadfa7083437d28f8808c550dbd4c1116bd3ddd09e6
  • Pointer size: 131 Bytes
  • Size of remote file: 258 kB
images-crops-concat/train-00003_p2.png ADDED

Git LFS Details

  • SHA256: 56b128f1dbf842c277f13e8f265229b0819722f8e25059a966e3fed861b8000d
  • Pointer size: 129 Bytes
  • Size of remote file: 6.43 kB
images-crops-concat/train-00005_p1.png ADDED

Git LFS Details

  • SHA256: 7e3dffe888f6679357e6db3acc8def971256802154b076c165da4363cacce199
  • Pointer size: 131 Bytes
  • Size of remote file: 261 kB
images-crops-concat/train-00005_p2.png ADDED

Git LFS Details

  • SHA256: c829216528e1530ed7e0d19991455e8ec235b656d92c46583564c3e1a9a46a24
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
images-crops-concat/train-00006_p1.png ADDED

Git LFS Details

  • SHA256: fff90b5f328a7c17566277b9ae533a0f3146d84a5a79432ba6f5285ddda1a601
  • Pointer size: 131 Bytes
  • Size of remote file: 269 kB
images-crops-concat/train-00006_p2.png ADDED

Git LFS Details

  • SHA256: 203af8af3428099597b6af584b4d9c716be6bdc458639f9b7da5fe3d41cd1ee0
  • Pointer size: 129 Bytes
  • Size of remote file: 3.25 kB
images-crops-concat/train-00009_p1.png ADDED

Git LFS Details

  • SHA256: 716e83c4431007b7f4971fd8959f402546c417525ab34ff24569a3c04e0da400
  • Pointer size: 131 Bytes
  • Size of remote file: 273 kB
images-crops-concat/train-00009_p2.png ADDED

Git LFS Details

  • SHA256: 5eb66d17008326f959b9536f5359a309d7678f082cd38bb525a966ab68f6afc5
  • Pointer size: 130 Bytes
  • Size of remote file: 86.9 kB
images-crops-concat/train-00010_p1.png ADDED

Git LFS Details

  • SHA256: c5a3e6477065ef61b0f8977694150c1032f5537624782a1626a467718d3c83e3
  • Pointer size: 131 Bytes
  • Size of remote file: 284 kB
images-crops-concat/train-00010_p2.png ADDED

Git LFS Details

  • SHA256: 0c3ed68eb616fac074a2a5f3cab3b108efef0f1d3ab7463f4c863fe34ebb01a8
  • Pointer size: 131 Bytes
  • Size of remote file: 169 kB
images-crops-concat/train-00012_p1.png ADDED

Git LFS Details

  • SHA256: 1758aeb506dc01fded07a223e33a176dc432d3c4302d466f5f236e586f86b73c
  • Pointer size: 131 Bytes
  • Size of remote file: 306 kB
images-crops-concat/train-00012_p2.png ADDED

Git LFS Details

  • SHA256: 10f2385876e192aead7a85a343088fcb8be0e69e46d3c78402ad90e391138671
  • Pointer size: 131 Bytes
  • Size of remote file: 114 kB
images-crops-concat/train-00015_p1.png ADDED

Git LFS Details

  • SHA256: 034d75437493a4f4488ff0bcf4a21ea3ba1110e6f3c2b985ae6710e431c90460
  • Pointer size: 131 Bytes
  • Size of remote file: 299 kB
images-crops-concat/train-00015_p2.png ADDED

Git LFS Details

  • SHA256: 62f5393a04035843f755c179054266c55288556a07db3485735228f09e50ff0d
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
images-crops-concat/train-00018_p1.png ADDED

Git LFS Details

  • SHA256: f84ec832669e5dfa145ee0128afeaade6de4dad827e8e1f2714bc4126c9c3cb0
  • Pointer size: 131 Bytes
  • Size of remote file: 289 kB
images-crops-concat/train-00018_p2.png ADDED

Git LFS Details

  • SHA256: 8a503f768a2a1f1ea7daf1071b6886b81a42502fd66a78bd8fc2a58827a9ded5
  • Pointer size: 131 Bytes
  • Size of remote file: 147 kB
images-crops-concat/train-00020_p1.png ADDED

Git LFS Details

  • SHA256: 251c47f4fabb196c523aa4b2d99403fef91322a61b80c341faa395466d59f3c7
  • Pointer size: 131 Bytes
  • Size of remote file: 167 kB
images-crops-concat/train-00020_p2.png ADDED

Git LFS Details

  • SHA256: 44817e40ec807976291fe78af11809a4907ea44984ed1f5e668b4faf466ac18d
  • Pointer size: 131 Bytes
  • Size of remote file: 113 kB
images-crops-concat/train-00021_p1.png ADDED

Git LFS Details

  • SHA256: 2f61df70b46f2760e350a66041ba1ce058be8a49731106e1ff488d579fb23b6c
  • Pointer size: 131 Bytes
  • Size of remote file: 158 kB
images-crops-concat/train-00021_p2.png ADDED

Git LFS Details

  • SHA256: be6d98a51956fc3bc706f41f4c1c975b749c4f2f3133e4a8c6c1cb8698c1b34a
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
images-crops-concat/train-00024_p1.png ADDED

Git LFS Details

  • SHA256: e806a1ed5628795050bbf9c45756b107dcddb24babae0c14ea18985e9ec5cc76
  • Pointer size: 131 Bytes
  • Size of remote file: 171 kB
images-crops-concat/train-00024_p2.png ADDED

Git LFS Details

  • SHA256: 25d2bdec2d6c6bd3b0a3741258f11933fd24afafcdaaf178d0e6cfa99a871de7
  • Pointer size: 131 Bytes
  • Size of remote file: 111 kB
images-crops-concat/train-00025_p1.png ADDED

Git LFS Details

  • SHA256: e48871d86203b7c1b4e3f1f722b6a758ca7e563eb84f3afb794aa12660217317
  • Pointer size: 131 Bytes
  • Size of remote file: 170 kB
images-crops-concat/train-00025_p2.png ADDED

Git LFS Details

  • SHA256: 7acb1021d5835423760ea416ef4b1164cd89c346da54a2d8a8781495fc1cac40
  • Pointer size: 131 Bytes
  • Size of remote file: 103 kB
images-crops-concat/train-00027_p1.png ADDED

Git LFS Details

  • SHA256: 9844b862d9bc9b8cdec9f66edb4f3364bf95e93b46198e12c943ce3096ef41d5
  • Pointer size: 131 Bytes
  • Size of remote file: 173 kB
images-crops-concat/train-00027_p2.png ADDED

Git LFS Details

  • SHA256: c60fb2aaf2444e2f230945f56486cd42682ac9e66cee15df1a6be5e8c9ff0ce4
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
images-crops-concat/train-00030_p1.png ADDED

Git LFS Details

  • SHA256: 7c65e810dd6b2a525c1725fe95036906a289f8aadd388b922c48bdd89485b100
  • Pointer size: 131 Bytes
  • Size of remote file: 116 kB
images-crops-concat/train-00030_p2.png ADDED

Git LFS Details

  • SHA256: 3eb57aaab2c4fb79e53f64c28935638b9e3edb4de31431c95d24883dc5db4cb9
  • Pointer size: 130 Bytes
  • Size of remote file: 46.1 kB
images-crops-concat/train-00033_p1.png ADDED

Git LFS Details

  • SHA256: 594ba2bd420e0b269df7da52330d46af713739c515033098b0d17711f29cf6cd
  • Pointer size: 131 Bytes
  • Size of remote file: 176 kB
images-crops-concat/train-00033_p2.png ADDED

Git LFS Details

  • SHA256: e67aaf0d7910e06c3665eee450d02a0b8244842d149f57b0176314c08ab6d4b2
  • Pointer size: 131 Bytes
  • Size of remote file: 209 kB
images-crops-concat/train-00033_p3.png ADDED

Git LFS Details

  • SHA256: b29057ee96ac88f3895b26206b9ca20f764c95eee7b9637ca692276201d952f3
  • Pointer size: 129 Bytes
  • Size of remote file: 7.65 kB
images-crops-concat/train-00035_p1.png ADDED

Git LFS Details

  • SHA256: ed225e3b73008192b30d96c0d4f7bb2552af38201f05b7de3c569f3ccd9158d4
  • Pointer size: 131 Bytes
  • Size of remote file: 226 kB
images-crops-concat/train-00035_p2.png ADDED

Git LFS Details

  • SHA256: 95783da6ab74184cca00fbde7750b24216cbe78e3bc0f7667ea9bd866d185d45
  • Pointer size: 131 Bytes
  • Size of remote file: 246 kB