Datasets:
pierreguillou
commited on
Commit
•
6be1d7c
1
Parent(s):
e921172
Update DocLayNet-small.py
Browse files- DocLayNet-small.py +3 -3
DocLayNet-small.py
CHANGED
@@ -25,7 +25,7 @@ DocLayNet dataset:
|
|
25 |
|
26 |
import json
|
27 |
import os
|
28 |
-
import base64
|
29 |
from PIL import Image
|
30 |
import datasets
|
31 |
|
@@ -121,7 +121,7 @@ class DocLayNet(datasets.GeneratorBasedBuilder):
|
|
121 |
)
|
122 |
),
|
123 |
"image": datasets.features.Image(),
|
124 |
-
#"pdf": datasets.Value("string"),
|
125 |
"page_hash": datasets.Value("string"), # unique identifier, equal to filename
|
126 |
"original_filename": datasets.Value("string"), # original document filename
|
127 |
"page_no": datasets.Value("int32"), # page number in original document
|
@@ -193,7 +193,7 @@ class DocLayNet(datasets.GeneratorBasedBuilder):
|
|
193 |
logger.info("⏳ Generating examples from = %s", filepath)
|
194 |
ann_dir = os.path.join(filepath, "annotations")
|
195 |
img_dir = os.path.join(filepath, "images")
|
196 |
-
pdf_dir = os.path.join(filepath, "pdfs")
|
197 |
|
198 |
for guid, file in enumerate(sorted(os.listdir(ann_dir))):
|
199 |
texts = []
|
|
|
25 |
|
26 |
import json
|
27 |
import os
|
28 |
+
# import base64
|
29 |
from PIL import Image
|
30 |
import datasets
|
31 |
|
|
|
121 |
)
|
122 |
),
|
123 |
"image": datasets.features.Image(),
|
124 |
+
# "pdf": datasets.Value("string"),
|
125 |
"page_hash": datasets.Value("string"), # unique identifier, equal to filename
|
126 |
"original_filename": datasets.Value("string"), # original document filename
|
127 |
"page_no": datasets.Value("int32"), # page number in original document
|
|
|
193 |
logger.info("⏳ Generating examples from = %s", filepath)
|
194 |
ann_dir = os.path.join(filepath, "annotations")
|
195 |
img_dir = os.path.join(filepath, "images")
|
196 |
+
# pdf_dir = os.path.join(filepath, "pdfs")
|
197 |
|
198 |
for guid, file in enumerate(sorted(os.listdir(ann_dir))):
|
199 |
texts = []
|