|
Download README.md from wqzh/DocLayout-PageLocationDataset: direct link, hf CLI and curl.
- Browser
- Download file 2 kB
-
https://huggingface.co/datasets/wqzh/DocLayout-PageLocationDataset/resolve/main/README.md
- Command line
-
hf download hf://datasets/wqzh/DocLayout-PageLocationDataset/README.md
-
curl -L -o README.md https://huggingface.co/datasets/wqzh/DocLayout-PageLocationDataset/resolve/main/README.md
2 kB
| <p align="center"> | |
| <a href="README.md">English</a> | <a href="README_ZH.md">中文</a> | |
| </p> | |
| # Introduction | |
| 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. | |
| # Page Number Cropping | |
| 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). | |
| 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`. | |
| You can run `src/2_det_onnx_wo_opencv_cuda.py` to detect page numbers, crop images, and save label files. | |
| ```shell | |
| find images-labels -type f -name "*.txt" | wc -l | |
| find images-crops -type f -name "*.jpg" | wc -l | |
| ``` | |
| - Number of `.txt` files in `images-labels`: 15902 | |
| - Number of `.jpg` files in `images-crops`: 17203 | |
| # Page Number Concatenation | |
| `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. | |
| Example | |
| <img src="images-crops-concat/train-00005_p1.png" width="500"> | |
| Note: If you intend to use the label files from this dataset, they need to be cleaned separately. | |
| # Page Number Coordinate Distribution | |
| `src/4_visualize_yolo_txt_distribution.py` visualizes the distribution of bounding box centers from all label files in `images-labels`. | |
| <img src="yolo_centers_distribution.png" width="500"> | |