Tylersuard commited on
Commit
7ef56ff
·
1 Parent(s): 09b6897

Update PathfinderX2.py

Browse files
Files changed (1) hide show
  1. PathfinderX2.py +1 -30
PathfinderX2.py CHANGED
@@ -86,19 +86,6 @@ class PathfinderX2(datasets.GeneratorBasedBuilder):
86
  "split": "training",
87
  },
88
  ),
89
- datasets.SplitGenerator(
90
- name=datasets.Split.TEST,
91
- gen_kwargs={
92
- "data": test_data,
93
- "split": "testing"},
94
- ),
95
- datasets.SplitGenerator(
96
- name=datasets.Split.VALIDATION,
97
- gen_kwargs={
98
- "data": val_data,
99
- "split": "validation",
100
- },
101
- ),
102
  ]
103
 
104
  def _generate_examples(self, data, split):
@@ -117,20 +104,4 @@ class PathfinderX2(datasets.GeneratorBasedBuilder):
117
  yield idx, {
118
  "image": {"path": path_img, "bytes": file_img.read()},
119
  "annotation": None,
120
- }
121
- else:
122
- images, annotations = data
123
- image_id2annot = {}
124
- # loads the annotations for the split into RAM (less than 100 MB) to support streaming
125
- for path_annot, file_annot in annotations:
126
- if path_annot.endswith(".png"):
127
- image_id = os.path.basename(path_annot).split(".")[0]
128
- image_id2annot[image_id] = (path_annot, file_annot.read())
129
- for idx, (path_img, file_img) in enumerate(images):
130
- if path_img.endswith(".png"):
131
- image_id = os.path.basename(path_img).split(".")[0]
132
- path_annot, bytes_annot = image_id2annot[image_id]
133
- yield idx, {
134
- "image": {"path": path_img, "bytes": file_img.read()},
135
- "annotation": {"path": path_annot, "bytes": bytes_annot},
136
- }
 
86
  "split": "training",
87
  },
88
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  ]
90
 
91
  def _generate_examples(self, data, split):
 
104
  yield idx, {
105
  "image": {"path": path_img, "bytes": file_img.read()},
106
  "annotation": None,
107
+ }