MVEB-train / README.md
HugC's picture
Upload folder using huggingface_hub
44a7ed3 verified
|
Raw
History Blame Contribute Delete
8.62 kB
---
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}
}
```