Update dataset card
Browse files
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc0-1.0
|
| 3 |
+
pretty_name: The Met Open Access — apple-mobileclip embeddings
|
| 4 |
+
tags:
|
| 5 |
+
- art
|
| 6 |
+
- museum
|
| 7 |
+
- embeddings
|
| 8 |
+
- apple-mobileclip
|
| 9 |
+
configs:
|
| 10 |
+
- config_name: default
|
| 11 |
+
data_files:
|
| 12 |
+
- split: train
|
| 13 |
+
path: default/train/apple-mobileclip-*.parquet
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# metmuseum/openaccess-embeddings-apple-mobileclip
|
| 17 |
+
|
| 18 |
+
Image embeddings for every public-domain artwork in [`metmuseum/openaccess`](https://huggingface.co/datasets/metmuseum/openaccess), produced by **apple/MobileCLIP-S2-OpenCLIP**.
|
| 19 |
+
|
| 20 |
+
| Column | Type | Notes |
|
| 21 |
+
|--------|------|-------|
|
| 22 |
+
| `objectID` | int64 | Primary key — matches `objectID` in `metmuseum/openaccess` |
|
| 23 |
+
| `embedding` | list<float32> | L2-normalised, dim = 512 |
|
| 24 |
+
| `model` | string | Source model id |
|
| 25 |
+
| `dim` | int32 | Embedding dimension |
|
| 26 |
+
|
| 27 |
+
Image bytes are **not** stored here; join against the main dataset to recover them.
|
| 28 |
+
|
| 29 |
+
Embedding spec: dim=512, expected image size=256px.
|
| 30 |
+
|
| 31 |
+
## Joining with the main dataset
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from datasets import load_dataset
|
| 35 |
+
|
| 36 |
+
meta = load_dataset("metmuseum/openaccess", split="train")
|
| 37 |
+
emb = load_dataset("metmuseum/openaccess-embeddings-apple-mobileclip", split="train")
|
| 38 |
+
|
| 39 |
+
# Build an objectID -> embedding lookup, then attach to the metadata rows.
|
| 40 |
+
lookup = {r["objectID"]: r["embedding"] for r in emb}
|
| 41 |
+
joined = meta.map(lambda r: {"embedding": lookup.get(r["objectID"])})
|
| 42 |
+
print(joined[0].keys())
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Nearest-neighbour example
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
import numpy as np
|
| 49 |
+
from datasets import load_dataset
|
| 50 |
+
|
| 51 |
+
emb = load_dataset("metmuseum/openaccess-embeddings-apple-mobileclip", split="train")
|
| 52 |
+
ids = np.array(emb["objectID"])
|
| 53 |
+
mat = np.array(emb["embedding"], dtype=np.float32) # already L2-normalised
|
| 54 |
+
|
| 55 |
+
query = mat[0]
|
| 56 |
+
scores = mat @ query
|
| 57 |
+
top = np.argsort(-scores)[:10]
|
| 58 |
+
print(list(zip(ids[top].tolist(), scores[top].tolist())))
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Generated by [`et-openaccess-embeddings`](https://github.com/metmuseum/et-openaccess-embeddings).
|