Xkull commited on
Commit
a54325c
1 Parent(s): 31188e5

Update phao_json.py

Browse files
Files changed (1) hide show
  1. phao_json.py +2 -2
phao_json.py CHANGED
@@ -277,7 +277,7 @@ class SceneParse150(datasets.GeneratorBasedBuilder):
277
  image_id = image_file.split(".")[0]
278
  yield idx, {
279
  "image": os.path.join(images_dir, image_file),
280
- "annotation": os.path.join(annotations_dir, image_id + ".json"),
281
  "scene_category": image_id2cat.loc[image_id, "scene_category"],
282
  }
283
  else:
@@ -293,7 +293,7 @@ class SceneParse150(datasets.GeneratorBasedBuilder):
293
  image_id2annot = {}
294
  # loads the annotations for the split into RAM (less than 100 MB) to support streaming
295
  for path_annot, file_annot in annotations:
296
- if split in path_annot and path_annot.endswith(".json"):
297
  image_id = os.path.basename(path_annot).split(".")[0]
298
  image_id2annot[image_id] = (path_annot, file_annot.read())
299
  for idx, (path_img, file_img) in enumerate(images):
 
277
  image_id = image_file.split(".")[0]
278
  yield idx, {
279
  "image": os.path.join(images_dir, image_file),
280
+ "annotation": os.path.join(annotations_dir, image_id + ".png"),
281
  "scene_category": image_id2cat.loc[image_id, "scene_category"],
282
  }
283
  else:
 
293
  image_id2annot = {}
294
  # loads the annotations for the split into RAM (less than 100 MB) to support streaming
295
  for path_annot, file_annot in annotations:
296
+ if split in path_annot and path_annot.endswith(".png"):
297
  image_id = os.path.basename(path_annot).split(".")[0]
298
  image_id2annot[image_id] = (path_annot, file_annot.read())
299
  for idx, (path_img, file_img) in enumerate(images):