Donut requires a specific directory structure for datasets. Each dataset must contain train, test, and validation directories, each containing a metadata.jsonl file and the corresponding image files.
metadata.jsonl format:
Each line in the .jsonl file must be a JSON object with:
file_name: The relative path to the image file.ground_truth: A JSON-dumped string containing either gt_parse or gt_parses.
Example Directory Structure:
dataset_name
├── test
│ ├── metadata.jsonl
│ ├── image0.jpg
│ └── image1.jpg
├── train
│ ├── metadata.jsonl
│ └── ...
└── validation
├── metadata.jsonl
└── ...
>
tree dataset_name
dataset_name
├── test
│ ├── metadata.jsonl
│ ├── {image_path0}
│ ├── {image_path1}
│ .
│ .
├── train
│ ├── metadata.jsonl
│ ├── {image_path0}
│ ├── {image_path1}
│ .
│ .
└── validation
├── metadata.jsonl
├── {image_path0}
├── {image_path1}
.
.