Datasets:
Update CC6204-Hackaton-Cub-Dataset.py
Browse files
CC6204-Hackaton-Cub-Dataset.py
CHANGED
@@ -36,7 +36,7 @@ for row in classes:
|
|
36 |
row = row.decode("UTF8")
|
37 |
if row != "":
|
38 |
idx, label = row.split(" ")
|
39 |
-
_ID2LABEL[idx] = re.search("[^\d\.\_+].+", label).group(0).replace("_", " ")
|
40 |
|
41 |
|
42 |
_NAMES = list(_ID2LABEL.values())
|
@@ -132,6 +132,6 @@ class CubDataset(datasets.GeneratorBasedBuilder):
|
|
132 |
if file_name.endswith(".jpg"):
|
133 |
yield i, {
|
134 |
"image": path,
|
135 |
-
"labels":
|
136 |
}
|
137 |
|
|
|
36 |
row = row.decode("UTF8")
|
37 |
if row != "":
|
38 |
idx, label = row.split(" ")
|
39 |
+
_ID2LABEL[int(idx)] = re.search("[^\d\.\_+].+", label).group(0).replace("_", " ")
|
40 |
|
41 |
|
42 |
_NAMES = list(_ID2LABEL.values())
|
|
|
132 |
if file_name.endswith(".jpg"):
|
133 |
yield i, {
|
134 |
"image": path,
|
135 |
+
"labels": _ID2LABEL[int(re.search("^\d+", file_name).group(0))],
|
136 |
}
|
137 |
|