Commit
·
09b6897
1
Parent(s):
8cc08a7
Update PathfinderX2.py
Browse files- PathfinderX2.py +4 -6
PathfinderX2.py
CHANGED
@@ -78,8 +78,6 @@ class PathfinderX2(datasets.GeneratorBasedBuilder):
|
|
78 |
train_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(
|
79 |
data_dirs["annotations"]
|
80 |
)
|
81 |
-
val_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(data_dirs["annotations"])
|
82 |
-
test_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(data_dirs["annotations"])
|
83 |
return [
|
84 |
datasets.SplitGenerator(
|
85 |
name=datasets.Split.TRAIN,
|
@@ -109,11 +107,11 @@ class PathfinderX2(datasets.GeneratorBasedBuilder):
|
|
109 |
image_id2annot = {}
|
110 |
# loads the annotations for the split into RAM (less than 100 MB) to support streaming
|
111 |
for path_annot, file_annot in annotations:
|
112 |
-
if
|
113 |
image_id = os.path.basename(path_annot).split(".")[0]
|
114 |
image_id2annot[image_id] = (path_annot, file_annot.read())
|
115 |
for idx, (path_img, file_img) in enumerate(images):
|
116 |
-
if
|
117 |
image_id = os.path.basename(path_img).split(".")[0]
|
118 |
path_annot, bytes_annot = image_id2annot[image_id]
|
119 |
yield idx, {
|
@@ -125,11 +123,11 @@ class PathfinderX2(datasets.GeneratorBasedBuilder):
|
|
125 |
image_id2annot = {}
|
126 |
# loads the annotations for the split into RAM (less than 100 MB) to support streaming
|
127 |
for path_annot, file_annot in annotations:
|
128 |
-
if
|
129 |
image_id = os.path.basename(path_annot).split(".")[0]
|
130 |
image_id2annot[image_id] = (path_annot, file_annot.read())
|
131 |
for idx, (path_img, file_img) in enumerate(images):
|
132 |
-
if
|
133 |
image_id = os.path.basename(path_img).split(".")[0]
|
134 |
path_annot, bytes_annot = image_id2annot[image_id]
|
135 |
yield idx, {
|
|
|
78 |
train_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(
|
79 |
data_dirs["annotations"]
|
80 |
)
|
|
|
|
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
|
|
107 |
image_id2annot = {}
|
108 |
# loads the annotations for the split into RAM (less than 100 MB) to support streaming
|
109 |
for path_annot, file_annot in annotations:
|
110 |
+
if path_annot.endswith(".png"):
|
111 |
image_id = os.path.basename(path_annot).split(".")[0]
|
112 |
image_id2annot[image_id] = (path_annot, file_annot.read())
|
113 |
for idx, (path_img, file_img) in enumerate(images):
|
114 |
+
if path_img.endswith(".png"):
|
115 |
image_id = os.path.basename(path_img).split(".")[0]
|
116 |
path_annot, bytes_annot = image_id2annot[image_id]
|
117 |
yield idx, {
|
|
|
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, {
|