Datasets:
lcolonn
commited on
fix: correct dict access
Browse files
patfig.py
CHANGED
@@ -70,9 +70,7 @@ class PatFig(GeneratorBasedBuilder):
|
|
70 |
def _generate_examples(self, images_dir: str, annotations_dir: str):
|
71 |
with open(annotations_dir, "r") as f:
|
72 |
data = json.load(f)
|
73 |
-
|
74 |
-
print(data)
|
75 |
-
for idx, record in enumerate(data):
|
76 |
image_path = os.path.join(images_dir, record["pub_number"], record["image_name"])
|
77 |
yield idx, {
|
78 |
"image": image_path,
|
|
|
70 |
def _generate_examples(self, images_dir: str, annotations_dir: str):
|
71 |
with open(annotations_dir, "r") as f:
|
72 |
data = json.load(f)
|
73 |
+
for idx, record in data.items():
|
|
|
|
|
74 |
image_path = os.path.join(images_dir, record["pub_number"], record["image_name"])
|
75 |
yield idx, {
|
76 |
"image": image_path,
|