add file with image links
Browse files
food_vision_199_classes.py
CHANGED
@@ -251,10 +251,10 @@ class Food199(datasets.GeneratorBasedBuilder):
|
|
251 |
"""
|
252 |
This function returns the logic to split the dataset into different splits as well as labels.
|
253 |
"""
|
254 |
-
csv = dl_manager.download("
|
255 |
df = pd.read_csv(csv)
|
256 |
print("Downloaded annotations.csv")
|
257 |
-
df_train_annotations = df[["
|
258 |
# df_test_annotations = df[["filename", "label"]][df["split"] == "test"].to_dict(orient="records")
|
259 |
|
260 |
return [
|
@@ -276,7 +276,7 @@ class Food199(datasets.GeneratorBasedBuilder):
|
|
276 |
This function takes in the kwargs from the _split_generators method and can then yield information from them.
|
277 |
"""
|
278 |
for id_, row in enumerate(annotations):
|
279 |
-
row["image"] = str(row.pop("
|
280 |
row["label"] = row.pop("class_name")
|
281 |
yield id_, row
|
282 |
|
|
|
251 |
"""
|
252 |
This function returns the logic to split the dataset into different splits as well as labels.
|
253 |
"""
|
254 |
+
csv = dl_manager.download("annotations_with_links.csv")
|
255 |
df = pd.read_csv(csv)
|
256 |
print("Downloaded annotations.csv")
|
257 |
+
df_train_annotations = df[["image", "class_name"]][df["split"] == "train"].to_dict(orient="records")
|
258 |
# df_test_annotations = df[["filename", "label"]][df["split"] == "test"].to_dict(orient="records")
|
259 |
|
260 |
return [
|
|
|
276 |
This function takes in the kwargs from the _split_generators method and can then yield information from them.
|
277 |
"""
|
278 |
for id_, row in enumerate(annotations):
|
279 |
+
row["image"] = str(row.pop("image"))
|
280 |
row["label"] = row.pop("class_name")
|
281 |
yield id_, row
|
282 |
|