Datasets:

Formats:
parquet
Languages:
English
ArXiv:
Tags:
image
Libraries:
Datasets
Dask
License:
File size: 982 Bytes
fc433d8
eeebcd8
fc433d8
 
 
 
f9175ad
fc433d8
eeebcd8
fc433d8
 
 
 
 
f9175ad
fc433d8
 
 
 
eeebcd8
fc433d8
 
 
f9175ad
fc433d8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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`:
```bash
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`:
```python
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](https://github.com/rom1504/img2dataset).  The example below will download all the images to a local `images` directory.
```bash
img2dataset download --url_list pd12m.01.parquet --input_format parquet --url_col url --caption_col caption --output-dir images/
```