File size: 1,939 Bytes
a6b6e3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
license: other
task_categories:
- image-classification
- zero-shot-image-classification
tags:
- face-recognition
- face-verification
- lfw
- imagefolder
pretty_name: LFW HF-ready
size_categories:
- 10K<n<100K
---

# LFW HF-ready

This folder packages the local LFW (Labeled Faces in the Wild) images as a
Hugging Face `imagefolder` dataset with the canonical 10-fold verification
pairs file.

## Layout

```
lfw/
├── README.md
├── pairs.csv
└── train/
    ├── images/<shard>/<file>.jpg
    └── metadata.csv
```

## metadata.csv columns

- `file_name`: relative image path used by `ImageFolder`, e.g. `images/000/Aaron_Eckhart_0001.jpg`.
- `label`: numeric identity label.
- `label_name` / `identity`: identity name.
- `image_num`: per-identity image index from the original filename (1-based).
- `source_filename`: original LFW filename.

## pairs.csv columns

`pairs.csv` mirrors the official LFW `pairs.txt` (10 folds x 300 positive +
300 negative = 6000 verification pairs).

- `pair_id` (0..5999), `fold_id` (1..10), `fold_position` (0..299).
- `is_same`: 1 for positive pairs (same identity), 0 for negatives.
- `image_a`, `image_b`: bare filenames (e.g. `Abel_Pacheco_0001.jpg`).
- `image_a_path`, `image_b_path`: paths under the `train` split.

## Local Stats

- Images: 13233
- Unique identities: 5749
- Identities with one image: 4069
- Verification pairs: 6000 (3000 positive / 3000 negative)
- Folds: 10 x 600 pairs

## Loading

```python
from datasets import load_dataset

ds = load_dataset("imagefolder", data_dir="data/evaluation/huggingface/lfw")
train = ds["train"]
```

```python
import pandas as pd

pairs = pd.read_csv("data/evaluation/huggingface/lfw/pairs.csv")
```

## Notes

LFW is described by its authors as an unconstrained face verification benchmark.
The images here are the original (non-aligned) drop. Check the original dataset
terms before publishing or redistributing it.