Update cell_benchmark.py
Browse files- cell_benchmark.py +5 -4
cell_benchmark.py
CHANGED
@@ -42,8 +42,8 @@ class Cellsegmentation(datasets.GeneratorBasedBuilder):
|
|
42 |
|
43 |
def _split_generators(self, dl_manager):
|
44 |
data_files = dl_manager.download_and_extract(_SPLIT_URLS)
|
45 |
-
#masks_dir = os.path.
|
46 |
-
masks_dir =
|
47 |
|
48 |
splits = [
|
49 |
datasets.SplitGenerator(
|
@@ -77,10 +77,11 @@ class Cellsegmentation(datasets.GeneratorBasedBuilder):
|
|
77 |
def _generate_examples(self, files, masks_dir, split):
|
78 |
masks_dir = masks_dir
|
79 |
for i, path in enumerate(files):
|
80 |
-
file_name = os.path.basename(path)
|
81 |
yield i, {
|
82 |
"image": path,
|
83 |
-
"masks": masks_dir + "/mask_" + file_name.replace("jpg", "png"),
|
|
|
84 |
"path": path,
|
85 |
}
|
86 |
|
|
|
42 |
|
43 |
def _split_generators(self, dl_manager):
|
44 |
data_files = dl_manager.download_and_extract(_SPLIT_URLS)
|
45 |
+
#masks_dir = [os.path.dirname(path) for i, path in enumerate(dl_manager.iter_files([data_files["masks"]])) if i < 1][0]
|
46 |
+
masks_dir = dl_manager.iter_files([data_files["masks"]])
|
47 |
|
48 |
splits = [
|
49 |
datasets.SplitGenerator(
|
|
|
77 |
def _generate_examples(self, files, masks_dir, split):
|
78 |
masks_dir = masks_dir
|
79 |
for i, path in enumerate(files):
|
80 |
+
file_name = "/mask_" + os.path.basename(path).replace("jpg", "png")
|
81 |
yield i, {
|
82 |
"image": path,
|
83 |
+
#"masks": masks_dir + "/mask_" + file_name.replace("jpg", "png"),
|
84 |
+
"masks": os.path.dirname(masks_dir) + file_name
|
85 |
"path": path,
|
86 |
}
|
87 |
|