Datasets:
Update tutorials/metadata.md
#6
by ppbrown - opened
123419 unmodified lines242526# Working with the MetadataThe metadata files are in parquet format, and contain the following attributes:- `id`: A unique identifier for the image.- `url`: The URL of the image.19 unmodified linesurls = df['url']```1234567891011121319 unmodified lines3334353637383940414243444546# Working with the Metadata## Downloading all the metadata files at onceInstall the huggingface-cli utility (via pip). You may then use the following command:huggingface-cli download Spawning/PD12M --repo-type dataset --local-dir metadata --include "metadata/*"## metadata formatThe metadata files are in parquet format, and contain the following attributes:- `id`: A unique identifier for the image.- `url`: The URL of the image.19 unmodified linesurls = df['url']```### Download all files mentioned in metadataIf you want to just grab all files referenced by a metadata collection, you may try this (adjust to taste):img2dataset --url_list $file --input_format "parquet" \--url_col "url" --caption_col "caption" --output_format files \--output_folder $dir --processes_count 16 --thread_count 64 \--skip_reencode true --min_image_sizel 654 --max_aspect_ratio=1.77
tutorials/metadata.md+20