From ce3b184d8ac1633c41ff78bf93cbe31725c16165 Mon Sep 17 00:00:00 2001 From: mariosasko Date: Fri, 12 Aug 2022 00:45:55 +0200 Subject: [PATCH] Update doc --- docs/source/image_load.mdx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/source/image_load.mdx b/docs/source/image_load.mdx index fdfc50a35be..29c56452b80 100644 --- a/docs/source/image_load.mdx +++ b/docs/source/image_load.mdx @@ -98,6 +98,8 @@ Your `metadata.jsonl` file must have a `file_name` column which links image file {"file_name": "0003.png", "additional_feature": "This is a third value of a text feature you added to your images"} ``` +It may be more convenient to specify metadata in CSV for simple tasks. In that case, use `metadata.csv` as the name of the metadata file. + If metadata files are present, the inferred labels based on the directory name are dropped by default. To include those labels, set `drop_labels=False` in `load_dataset`. @@ -106,12 +108,13 @@ If metadata files are present, the inferred labels based on the directory name a ### Image captioning -Image captioning datasets have text describing an image. An example `metadata.jsonl` may look like: +Image captioning datasets have text describing an image. An example `metadata.csv` may look like: ```jsonl -{"file_name": "0001.png", "text": "This is a golden retriever playing with a ball"} -{"file_name": "0002.png", "text": "A german shepherd"} -{"file_name": "0003.png", "text": "One chihuahua"} +file_name,text +0001.png,This is a golden retriever playing with a ball +0002.png,A german shepherd +0003.png,One chihuahua ``` Load the dataset with `ImageFolder`, and it will create a `text` column for the image captions: