Datasets:
|
Download tutorials/images.md from Spawning/PD12M: direct link, hf CLI and curl.
- Browser
- Download file 982 Bytes
-
https://huggingface.co/datasets/Spawning/PD12M/resolve/main/tutorials/images.md
- Command line
-
hf download hf://datasets/Spawning/PD12M/tutorials/images.md
-
curl -L -o images.md https://huggingface.co/datasets/Spawning/PD12M/resolve/main/tutorials/images.md
982 Bytes
Downloading Images
Once you have the URLs from the metadata files, you can download the images through any standard means.
cURL
Download an image from a url to a local image file with the name image.png:
curl -O image.png https://pd12m.s3.us-west-2.amazonaws.com/images/image.png
Python
Download an image from a url to a local image file with the name image.png:
import requests
url = "https://pd12m.s3.us-west-2.amazonaws.com/images/image.png"
response = requests.get(url)
with open('image.png', 'wb') as f:
f.write(response.content)
img2dataset
You can also use the img2dataset tool to quickly download images from a metadata file. The tool is available here. The example below will download all the images to a local images directory.
img2dataset download --url_list pd12m.01.parquet --input_format parquet --url_col url --caption_col caption --output-dir images/