vkashko commited on
Commit
22f23a4
·
1 Parent(s): 86f83df

fix: open json

Browse files
Files changed (1) hide show
  1. body-measurements-dataset.py +2 -2
body-measurements-dataset.py CHANGED
@@ -120,7 +120,6 @@ class BodyMeasurementsDataset(datasets.GeneratorBasedBuilder):
120
  ]
121
 
122
  def _generate_examples(self, files, proofs, annotations):
123
- annotations_df = pd.read_csv(annotations, sep=';')
124
  files = list(files)
125
  files = [files[i:i + 4] for i in range(0, len(files), 4)]
126
  proofs = list(proofs)
@@ -136,7 +135,8 @@ class BodyMeasurementsDataset(datasets.GeneratorBasedBuilder):
136
  elif 'side_img' in file:
137
  data['side_img'] = file
138
  elif 'measurements' in file:
139
- data.update(json.load(file))
 
140
 
141
  for proof in proofs_dir:
142
  if "arm_circumference" in proof:
 
120
  ]
121
 
122
  def _generate_examples(self, files, proofs, annotations):
 
123
  files = list(files)
124
  files = [files[i:i + 4] for i in range(0, len(files), 4)]
125
  proofs = list(proofs)
 
135
  elif 'side_img' in file:
136
  data['side_img'] = file
137
  elif 'measurements' in file:
138
+ with open(file) as f:
139
+ data.update(json.load(f))
140
 
141
  for proof in proofs_dir:
142
  if "arm_circumference" in proof: