Datasets:
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
task_categories:
|
3 |
+
- text-to-image
|
4 |
+
pretty_name: Pexels Portrait
|
5 |
+
---
|
6 |
+
# Pexels Portrait
|
7 |
+
|
8 |
+
This dataset was collected using the official Pexels API: https://www.pexels.com/api/
|
9 |
+
|
10 |
+
All fields returned by the API are recorded, except the source image URL. Only the original image URL is recorded, since other variants can be retrieved on-the-fly by modifying the URL parameters. The "alt" field can be used for simple text-to-image training/finetuning.
|
11 |
+
|
12 |
+
Image files are not provided. You need to download the image files by yourself. Example of downloading image files:
|
13 |
+
|
14 |
+
```python
|
15 |
+
def download(_id: int, url: str):
|
16 |
+
# corresponds to "large"
|
17 |
+
params = dict(auto="compress", cs="tinysrgb", dpr=2, h=650, w=940)
|
18 |
+
resp = requests.get(url, params=params)
|
19 |
+
resp.raise_for_status()
|
20 |
+
|
21 |
+
save_path = save_dir / str(_id)[-3:] / f"{_id}.webp"
|
22 |
+
save_path.parent.mkdir(exist_ok=True, parents=True)
|
23 |
+
open(save_path, "wb").write(resp.content)
|
24 |
+
```
|
25 |
+
|
26 |
+
Photos without human faces were removed with [YOLOv8-Face](https://github.com/hpc203/yolov8-face-landmarks-opencv-dnn), using score threshold 0.7.
|
27 |
+
|
28 |
+
More samples might be added in the future.
|