lcolonn commited on
Commit
df2e7e1
·
unverified ·
1 Parent(s): fec1472

fix: correct dict access

Browse files
Files changed (1) hide show
  1. patfig.py +1 -3
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
- print(data.type())
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,