ArielleE commited on
Commit
dfdff40
·
1 Parent(s): c4d7a2b

Update Superimposed-Masked-Dataset.py

Browse files
Files changed (1) hide show
  1. Superimposed-Masked-Dataset.py +8 -9
Superimposed-Masked-Dataset.py CHANGED
@@ -86,12 +86,11 @@ class SMD(datasets.GeneratorBasedBuilder):
86
  label = IMAGENET2012_CLASSES[synset_id]
87
 
88
  mask_file_path = path.replace("_occluded.png", "_mask.npy")
89
- segmentation_mask = mask_files.get(mask_file_path, None)
90
- if segmentation_mask is not None:
91
- ex = {
92
- "image": {"path": path, "bytes": file.read()},
93
- "label": label,
94
- "segmentation": segmentation_mask.tolist() # Convert numpy array to list
95
- }
96
- yield idx, ex
97
- idx += 1
 
86
  label = IMAGENET2012_CLASSES[synset_id]
87
 
88
  mask_file_path = path.replace("_occluded.png", "_mask.npy")
89
+ segmentation_mask = mask_files.get(mask_file_path)
90
+ ex = {
91
+ "image": {"path": path, "bytes": file.read()},
92
+ "label": label,
93
+ "segmentation": segmentation_mask.tolist() # Convert numpy array to list
94
+ }
95
+ yield idx, ex
96
+ idx += 1