File size: 8,618 Bytes
2779abe
44a7ed3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2779abe
44a7ed3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
---
pretty_name: MVEB-train
license: cc-by-nc-sa-4.0
tags:
  - embedding
  - retrieval
  - multimodal-embedding
  - identity-retrieval
  - benchmark
multi-modal:
  Feature Extraction:
    languages:
      - en
configs:
- config_name: sample
  default: true
  data_files:
  - split: COCOEdit
    path: sample/COCOEdit.parquet
  - split: Cars196
    path: sample/Cars196.parquet
  - split: CompCars
    path: sample/CompCars.parquet
  - split: DukeMTMC
    path: sample/DukeMTMC.parquet
  - split: GLDV2
    path: sample/GLDV2.parquet
  - split: GPTImageEdit
    path: sample/GPTImageEdit.parquet
  - split: IDMR
    path: sample/IDMR.parquet
  - split: IUST
    path: sample/IUST.parquet
  - split: Inshop
    path: sample/Inshop.parquet
  - split: MET
    path: sample/MET.parquet
  - split: MS_Celeb_1M
    path: sample/MS-Celeb-1M.parquet
  - split: MultiID
    path: sample/MultiID.parquet
  - split: PIPA
    path: sample/PIPA.parquet
  - split: Rp2k
    path: sample/Rp2k.parquet
  - split: SEED_Multi_Turn
    path: sample/SEED_Multi_Turn.parquet
  - split: SOP
    path: sample/SOP.parquet
  - split: SynCPR
    path: sample/SynCPR.parquet
  - split: VeRi776
    path: sample/VeRi776.parquet
  - split: iCartoonFace
    path: sample/iCartoonFace.parquet
  - split: iNat
    path: sample/iNat.parquet
---

# MVEB Train Split

English | [简体中文](README.md)

![MVEB Overview](assets/dataset.png)

This repository contains the **train** split of [MVEB](https://chrisclear3.github.io/MVEB/) (Multimodal Visual identity Embedding Benchmark) — a benchmark for identity-level retrieval. Given a query (text + image), a model retrieves candidates (text + image) that belong to the same identity.

The train split covers **20 subsets** across four meta-tasks:

- **Identity Recognition** — object / product / species recognition
- **Re-Identification** — person / face / vehicle re-ID
- **Identity Grounding** — grounding queries to visual identities
- **Identity Editing** — retrieval over edited image pairs

> The **test** split is published separately and includes **8 additional OOD subsets** not present in train (e.g. Product1m, Market1501, FORB, OpenGPT4o). See the corresponding test repository for evaluation data.

> **Not every subset is redistributable.** `CompCars`, `DukeMTMC`, `Inshop`,
> `IUST`, `MS-Celeb-1M` and `MultiID` are **not shipped** in this repository —
> rebuild them locally as described in
> [Rebuilding Restricted Subsets](#rebuilding-restricted-subsets). The other
> **14 subsets** are included as parquet files.

## Directory Layout

Each subset is stored as three components:

| File | Description |
|------|-------------|
| `query.parquet` | Query metadata (`instruction`, `text`, `pos_ids`, …) |
| `candidate.parquet` | Candidate-pool metadata |
| `media-*.parquet` | Deduplicated media pool (`image` / `video` / `audio`) |

`query` and `candidate` rows reference the shared media pool via `media_index`, so each image is stored only once.

## Loading Data

Each subset exposes three HuggingFace configs: `{Subset}_media`, `{Subset}_query`, and `{Subset}_candidate`. The split name is `train`.

```python
from datasets import load_dataset

repo = "HugC/MVEB-train"  # Hub repo id, or a local directory path

query = load_dataset(repo, "Cars196_query", split="train")
candidate = load_dataset(repo, "Cars196_candidate", split="train")
media = load_dataset(repo, "Cars196_media", split="train")

print(query[0])
# {'id': '0', 'instance_id': '0', 'instruction': '...', 'text': '...',
#  'pos_ids': ['1', '2', ...], 'media_index': 0}
```

> **Note:** The third positional argument to `load_dataset` is `data_dir`, not `split`. Always pass `split="train"` as a keyword argument.

### Resolving Images

`query` and `candidate` parquets do **not** embed images. Resolve them through `media_index`:

```python
from datasets import load_dataset

repo = "HugC/MVEB-train"
query = load_dataset(repo, "Cars196_query", split="train")
media = load_dataset(repo, "Cars196_media", split="train")

row = query[0]
image = media[row["media_index"]]["image"]  # PIL.Image
```

### Schema

**query.parquet** (typical fields):

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Query sample id |
| `instance_id` | string | Identity / instance id (absent in some subsets) |
| `instruction` | string | System instruction |
| `text` | string | User text |
| `pos_ids` | list[string] | Positive candidate id list |
| `media_index` | int | Row index into the media pool |

**candidate.parquet** — similar to query; usually without `pos_ids`.

**media-*.parquet** — columns `image`, `video`, `audio`. Currently image-only; `video` and `audio` are reserved for future multimodal extensions.

## Rebuilding Restricted Subsets

A few subsets come from sources whose licences do not allow redistribution, so
they are **not shipped** in either repository and must be rebuilt locally from
the original providers. `scripts/` holds that pipeline for both splits — it is
shipped **only in this repository**, and the same scripts also produce the
corresponding test subsets.

Covered subsets: `CompCars`, `DukeMTMC`, `Inshop`, `IUST`, `MS-Celeb-1M`,
`MultiID` (train + test) and `Product1m` (test only).

### Layout

```
scripts/
├── run.sh                  # one-click runner for all subsets
├── pack_media_parquet.py   # shared parquet packing library
└── <Subset>/
    ├── process.sh           # download -> extract -> pack
    ├── process_<subset>.py   # split-aware parquet builder
    └── train_test_split.json # frozen split, keeps rebuilds reproducible
```

### Recommended Order

Download both repositories **before** running the scripts, so that rebuilt
subsets land next to the already published ones:

```bash
huggingface-cli download HugC/MVEB-train --repo-type dataset --local-dir MVEB-train
huggingface-cli download HugC/MVEB-test  --repo-type dataset --local-dir MVEB-test

bash MVEB-train/scripts/run.sh              # all subsets
bash MVEB-train/scripts/run.sh DukeMTMC     # selected subsets
bash MVEB-train/scripts/run.sh --list       # show available subsets
```

Running the scripts first and downloading afterwards is discouraged: the
download never removes local files, so stale `media-*.parquet` shards from an
earlier rebuild could be picked up alongside the downloaded ones.

### Paths

With the layout above no configuration is needed. Override these environment
variables to place outputs elsewhere:

| Variable | Meaning | Default |
|----------|---------|---------|
| `MVEB_TRAIN_DIR` | destination for train subsets | this repository (parent of `scripts/`) |
| `MVEB_TEST_DIR` | destination for test subsets | `MVEB-test` next to this repository |
| `MVEB_ROOT` | scratch space for `downloads/`, `source/`, `logs/` | parent of this repository |

```bash
MVEB_TEST_DIR=/data/MVEB-test MVEB_ROOT=/scratch bash MVEB-train/scripts/run.sh
```

Raw downloads and extracted images under `MVEB_ROOT` are only needed while
rebuilding and can be deleted afterwards.

### Requirements

- `python3` with `datasets`, `pyarrow`, `pillow`, `tqdm`, `requests`
- `kaggle` (DukeMTMC, Inshop, IUST) with an API token in `~/.kaggle/kaggle.json`
- `huggingface-cli` (MS-Celeb-1M, MultiID), `gdown` (CompCars), `git` (Product1m)
- `unzip`, `zip`, `tar`

`run.sh` reports missing commands before it starts.

### Re-running After a Failure

Every stage is resumable, so simply re-run the same command:

- downloads resume or skip already fetched files; `Product1m` re-fetches only missing images
- extraction is guarded by an `.extracted` marker written on success, so an interrupted archive is redone
- parquet packing always rewrites the subset directory from scratch

A failing subset does not abort the others. Per-subset logs are written to
`${MVEB_ROOT}/logs/<Subset>.log`, and the final summary lists the command that
retries just the failed subsets.

If CompCars reports a truncated split volume, delete the file it names and
re-run — `gdown` skips existing files by size-agnostic name matching, so a
partial volume has to be removed explicitly.

## Citation

If you find MVEB useful in your research, please cite:

```bibtex
@inproceedings{cao2026illuminating,
  title={Illuminating Visual Identity in Universal Multimodal Embeddings},
  author={Cao, Jiawei and Feng, Junyi and Hua, Jiashen and Huang, Ziheng and Deng, Bing and Wu, Kaijie and Gu, Chaochen and Ye, Jieping},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={8737--8748},
  year={2026}
}
```