image_path string | caption string | NSFW string | similarity float64 | LICENSE string | url string | key string | status string | error_message null | width int64 | height int64 | original_width int64 | original_height int64 | exif string | md5 string | img_emb list | image image |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
185120556 | Cordelia and Dudley on their wedding day last year | UNLIKELY | 0.292647 | ? | 185120556 | success | null | 233 | 315 | 233 | 315 | {} | a25c6b1e5dc9e2ec090dd38091467912 | [
0.0535888671875,
0.055755615234375,
0.0098876953125,
0.02960205078125,
0.006862640380859375,
-0.0127410888671875,
0.0279541015625,
-0.01065826416015625,
-0.0112152099609375,
0.08856201171875,
0.022552490234375,
-0.01274871826171875,
-0.0084991455078125,
0.0239410400390625,
0.022857666015... | ||
185120566 | Statistics on challenges for automation in 2021 | UNLIKELY | 0.301743 | ? | 185120566 | success | null | 701 | 299 | 701 | 299 | {} | ec9606053a369e0961dc016eafddb562 | [
0.026458740234375,
-0.032318115234375,
-0.0032863616943359375,
0.004337310791015625,
0.00960540771484375,
0.003627777099609375,
-0.01230621337890625,
0.011627197265625,
-0.0308837890625,
-0.010467529296875,
-0.0201263427734375,
0.004291534423828125,
-0.00109100341796875,
-0.002901077270507... | ||
185120575 | Teacher Gifts / Great gifts for your child's teacher. Don't know what to get? Take a look at these gifts that the teacher in your life will love! | UNLIKELY | 0.336206 | ? | 185120575 | success | null | 216 | 111 | 216 | 111 | {} | 410f7d76c9360d1c9af0d50573e8fb68 | [
-0.036407470703125,
-0.025604248046875,
0.00732421875,
0.04046630859375,
0.0018062591552734375,
-0.0018205642700195312,
-0.0033588409423828125,
0.0250701904296875,
-0.035308837890625,
-0.01264190673828125,
0.011383056640625,
-0.020843505859375,
0.0191650390625,
0.042816162109375,
0.00734... | ||
185120587 | Safavieh Courtyard Cy6923 26 Power Loomed Rug | UNLIKELY | 0.320005 | ? | 185120587 | success | null | 160 | 160 | 160 | 160 | {"Image Orientation": "Horizontal (normal)", "Image XResolution": "300", "Image YResolution": "300", "Image ResolutionUnit": "Pixels/Inch", "Image YCbCrPositioning": "Centered", "Image ExifOffset": "102", "EXIF ExifVersion": "0210", "EXIF ComponentsConfiguration": "YCbCr", "EXIF FlashPixVersion": "0100", "EXIF ColorSpa... | b8f6d71d3db1b7856e6d7f0fb184949c | [
-0.05224609375,
0.0133209228515625,
-0.0182037353515625,
-0.01018524169921875,
0.045440673828125,
-0.0260162353515625,
0.0158233642578125,
-0.0284881591796875,
-0.0268707275390625,
-0.034637451171875,
-0.02679443359375,
-0.01044464111328125,
-0.01001739501953125,
-0.0540771484375,
-0.038... | ||
185120578 | Memorial from flowers set up on Boylston Street in Boston, USA Stock Photo | UNLIKELY | 0.313025 | ? | 185120578 | success | null | 240 | 160 | 240 | 160 | {"Image XResolution": "300", "Image YResolution": "300", "Image ResolutionUnit": "Pixels/Inch", "Image YCbCrPositioning": "Centered", "Image Copyright": "(c) Fmua | Dreamstime.com", "Image XPTitle": "[104, 0, 116, 0, 116, 0, 112, 0, 58, 0, 47, 0, 47, 0, 119, 0, 119, 0, 119, 0, ... ]"} | 0fc56a3912eef6f6e39c935779a8149c | [
-0.029266357421875,
0.07659912109375,
0.01030731201171875,
0.09527587890625,
-0.00811004638671875,
-0.021270751953125,
-0.0280914306640625,
-0.0189056396484375,
-0.001007080078125,
0.050048828125,
0.0321044921875,
-0.0221099853515625,
-0.0016660690307617188,
0.024078369140625,
-0.0251464... | ||
185120581 | Treacy Lowe Indian Silk Chiffon Black & Purple Floral Embroidered Dress, 1970s | UNLIKELY | 0.314395 | ? | 185120581 | success | null | 240 | 240 | 240 | 240 | {} | aadfb2eb78f0d65992bf32d5c6f4e79a | [
0.08489990234375,
-0.03656005859375,
-0.04901123046875,
0.0207366943359375,
-0.02392578125,
0.002468109130859375,
0.0184326171875,
0.013580322265625,
0.0762939453125,
-0.01424407958984375,
-0.0196075439453125,
-0.047149658203125,
0.0211181640625,
-0.033294677734375,
0.007450103759765625,... | ||
185120505 | Mali 2011 Butterflies #2 perf sheetlet containing 4 values unmounted mint. Note this item is privately produced and is offered purely on its thematic appeal | UNLIKELY | 0.326235 | ? | 185120505 | success | null | 435 | 384 | 825 | 729 | {} | 9baeab0d525ae432b7d1e04ed98aa4ef | [
0.005519866943359375,
0.026092529296875,
-0.01544952392578125,
0.0193328857421875,
-0.0085906982421875,
0.023651123046875,
0.01239776611328125,
0.0291748046875,
-0.03228759765625,
-0.0148162841796875,
0.0225982666015625,
-0.06951904296875,
-0.0227203369140625,
0.030120849609375,
0.013641... | ||
185120572 | wedding-cake-atlanta | UNLIKELY | 0.307268 | ? | https://images.squarespace-cdn.com/content/55f0afc1e4b0ee42a62141d6/1501044515987-FJ6XM935R5RB0C7AYQMA/wedding-cake-atlanta?format=1000w&content-type=image%2Fjpeg | 185120572 | success | null | 384 | 576 | 1,000 | 1,500 | {} | 2a5704551ce2893bdbbc8c665a2780de | [
-0.017303466796875,
0.0242919921875,
-0.007556915283203125,
-0.00594329833984375,
-0.0007824897766113281,
-0.0161285400390625,
-0.01012420654296875,
0.0002313852310180664,
-0.0290985107421875,
0.038604736328125,
0.037109375,
-0.019073486328125,
0.04498291015625,
0.0682373046875,
-0.00097... | |
185120588 | "Guardhouse Double Row Standard Slab Box - 12"" Slab & Krown Regular Duty Long Chipboard Box Guardhouse Double Row Green, Guardhouse, GH-12x5 3/4x3" | UNLIKELY | 0.320393 | ? | 185120588 | success | null | 300 | 360 | 300 | 360 | {} | bff36fc78ab6bf05957111c5092c344d | [
-0.0050201416015625,
0.0914306640625,
0.01543426513671875,
-0.083984375,
0.0079803466796875,
0.0052947998046875,
0.06842041015625,
0.02301025390625,
0.03271484375,
0.025390625,
0.031341552734375,
0.0330810546875,
0.05438232421875,
-0.01268768310546875,
-0.0068206787109375,
0.0039825439... | ||
185120570 | table lamp lighting line icon for web vector image | UNLIKELY | 0.301689 | ? | 185120570 | success | null | 238 | 250 | 238 | 250 | {} | 3ca36b614511256d683b16537a91245f | [
-0.00812530517578125,
0.054229736328125,
0.00843048095703125,
-0.0264739990234375,
-0.00032830238342285156,
0.019744873046875,
-0.00847625732421875,
0.0119171142578125,
-0.06866455078125,
0.018646240234375,
0.009124755859375,
-0.029937744140625,
0.04217529296875,
0.0012712478637695312,
-... | ||
185120576 | Bricks Recycled Price Per 1000. Delivery Available. Paving & Feature Ashfield Ashfield Area Preview | UNLIKELY | 0.309791 | ? | 185120576 | success | null | 220 | 165 | 220 | 165 | {} | 78eff6176e50592797322febcd916b14 | [
-0.052734375,
0.015594482421875,
0.00839996337890625,
0.0277862548828125,
0.03826904296875,
-0.028900146484375,
-0.0088348388671875,
-0.019561767578125,
0.00902557373046875,
-0.0014448165893554688,
-0.040069580078125,
-0.0129241943359375,
-0.04376220703125,
0.00786590576171875,
-0.012237... | ||
208260010 | Big mouth gulper angler fish pencil drawing | UNLIKELY | 0.320322 | ? | http://rlv.zcache.com.au/big_mouth_gulper_angler_fish_pencil_drawing-r30957d8eb0344b009e46fccb3eaedca7_vgbaq_8byvr_324.jpg | 208260010 | success | null | 324 | 324 | 324 | 324 | {"Image ExifOffset": "22"} | a330883940bcc4fa7a614c4e2472b068 | [
-0.0007557868957519531,
-0.0019464492797851562,
-0.01145172119140625,
-0.00936126708984375,
0.006450653076171875,
0.0228424072265625,
0.006053924560546875,
0.01104736328125,
0.01517486572265625,
0.058074951171875,
0.0188140869140625,
-0.04608154296875,
-0.048126220703125,
0.01763916015625,... | |
208260015 | "Freewing Seagull 4-in-1 Prop and EDF 1400mm (55"") Wingspan - PNP FG20113P" | UNLIKELY | 0.310703 | ? | 208260015 | success | null | 576 | 384 | 1,020 | 680 | {"Image HostComputer": "imagery4"} | 29440cee0bcd10f51c7c32592ffbb5e3 | [
-0.0478515625,
0.0419921875,
0.01302337646484375,
-0.053436279296875,
0.03253173828125,
0.0313720703125,
-0.014892578125,
-0.01617431640625,
-0.044830322265625,
-0.0207977294921875,
-0.055755615234375,
-0.035186767578125,
0.035675048828125,
-0.01000213623046875,
0.002361297607421875,
-... |
YAML Metadata Warning:The task_categories "image-retrieval" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
YAML Metadata Warning:The task_categories "multi-modal-retrieval" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
YAML Metadata Warning:The task_categories "lance" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
LAION-Subset (Lance Format)
A Lance-formatted slice of the LAION image-text corpus (~1M rows) with inline JPEG bytes, CLIP image embeddings (img_emb), full metadata, and a pre-built ANN index — all available directly from the Hub at hf://datasets/lance-format/laion-1m/data/train.lance.
Key features
- Inline JPEG bytes in the
imagecolumn — no sidecar files, no image folders. - Pre-computed CLIP image embeddings (
img_emb, 768-dim) with a bundledIVF_PQindex for similarity search. - Full LAION metadata — captions, URLs, NSFW flags, EXIF, dimensions, similarity scores.
- One columnar dataset — scan metadata cheaply, then fetch image bytes only for the rows you want.
Splits
train.lance
Schema
| Column | Type | Notes |
|---|---|---|
key |
int64 |
Row key (natural join key for merges) |
image |
large_binary |
Inline JPEG bytes |
image_path |
string |
Original filename |
caption |
string |
Image caption |
url |
string |
Source URL |
NSFW |
int64 |
0 = safe, 1 = NSFW |
LICENSE |
string |
Per-row license tag |
similarity |
float64 |
CLIP image–text cosine similarity |
width, height |
int64 |
Image dimensions |
original_width, original_height |
int64 |
Original dimensions before resize |
exif, md5, status, error_message |
string |
Provenance / metadata |
img_emb |
fixed_size_list<float32, 768> |
CLIP image embedding |
Pre-built indices
IVF_PQonimg_emb— vector similarity search (L2)
Why Lance?
- Blazing Fast Random Access: Optimized for fetching scattered rows, making it ideal for random sampling, real-time ML serving, and interactive applications without performance degradation.
- Native Multimodal Support: Store text, embeddings, and other data types together in a single file. Large binary objects are loaded lazily, and vectors are optimized for fast similarity search.
- Native Index Support: Lance comes with fast, on-disk, scalable vector and FTS indexes that sit right alongside the dataset on the Hub, so you can share not only your data but also your embeddings and indexes without your users needing to recompute them.
- Efficient Data Evolution: Add new columns and backfill data without rewriting the entire dataset. This is perfect for evolving ML features, adding new embeddings, or introducing moderation tags over time.
- Versatile Querying: Supports combining vector similarity search, full-text search, and SQL-style filtering in a single query, accelerated by on-disk indexes.
- Data Versioning: Every mutation commits a new version; previous versions remain intact on disk. Tags pin a snapshot by name, so retrieval systems and training runs can reproduce against an exact slice of history.
Load with datasets.load_dataset
You can load Lance datasets via the standard HuggingFace datasets interface, suitable if your pipeline already speaks Dataset / IterableDataset or you want a quick streaming sample without installing anything Lance-specific.
import datasets
hf_ds = datasets.load_dataset("lance-format/laion-1m", split="train", streaming=True)
for row in hf_ds.take(3):
print(row["caption"])
Load with LanceDB
LanceDB is the embedded retrieval library built on top of the Lance format (docs), and is the interface most users interact with. It wraps the dataset as a queryable table with search and filter builders, and is the entry point used by the Search, Curate, Evolve, and Versioning examples below.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
tbl = db.open_table("train")
print(len(tbl))
Load with Lance
pylance is the Python binding for the Lance format and works directly with the format's lower-level APIs. Reach for it when you want to inspect or operate on dataset internals — schema, scanner, fragments, and the list of pre-built indices.
import lance
ds = lance.dataset("hf://datasets/lance-format/laion-1m/data/train.lance")
print(ds.count_rows(), ds.schema.names)
print(ds.list_indices())
Tip — for production use, download locally first. Streaming from the Hub works for exploration, but heavy random access and ANN search are far faster against a local copy:
hf download lance-format/laion-1m --repo-type dataset --local-dir ./laion-1mThen point Lance or LanceDB at
./laion-1m/data.
Search
The bundled IVF_PQ index on img_emb makes approximate-nearest-neighbor search a single call. In production you would encode a user prompt or query image through CLIP at runtime and pass the resulting 768-d vector to tbl.search(...). The example below uses the embedding from row 42 as a runnable stand-in.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
tbl = db.open_table("train")
query = (
tbl.search()
.select(["img_emb"])
.limit(1)
.offset(42)
.to_list()[0]["img_emb"]
)
hits = (
tbl.search(query)
.metric("L2")
.select(["caption", "url", "similarity"])
.limit(10)
.to_list()
)
for r in hits:
print(f"{r['similarity']:.3f} | {r['caption'][:80]}")
Tune metric, nprobes, and refine_factor to trade recall against latency for your workload.
Curate
Building a focused subset usually means combining similarity with metadata filters. Lance evaluates both inside a single query, so the candidate set comes back already filtered. The example below finds images visually similar to a seed row and restricts the result to safe-rated, high-resolution rows in one call. The bounded .limit(500) keeps the output small enough to inspect or hand off.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
tbl = db.open_table("train")
seed = (
tbl.search()
.select(["img_emb", "caption"])
.limit(1)
.offset(42)
.to_list()[0]
)
candidates = (
tbl.search(seed["img_emb"])
.where('"NSFW" = 0 AND similarity > 0.3 AND width >= 512', prefilter=True)
.select(["key", "url", "caption", "similarity"])
.limit(500)
.to_list()
)
print(f"{len(candidates)} candidates around: {seed['caption'][:60]}")
The result is a plain list of dictionaries, ready to inspect, persist as a manifest of row keys, or feed into the Evolve and Train workflows below.
Evolve
Lance stores each column independently, so a new column can be appended without rewriting the existing data. The lightest form is a SQL expression: derive the new column from columns that already exist, and Lance computes it once and persists it. The example below adds a precomputed aspect_ratio and an is_high_res flag, either of which can then be used directly in where clauses without recomputing the predicate on every query.
Note: Mutations require a local copy of the dataset, since the Hub mount is read-only. See the Materialize-a-subset section at the end of this card for a streaming pattern that downloads only the rows and columns you need, or use
hf downloadto pull the full corpus.
import lancedb
db = lancedb.connect("./laion-1m/data") # local copy required for writes
tbl = db.open_table("train")
tbl.add_columns({
"aspect_ratio": "CAST(width AS DOUBLE) / CAST(height AS DOUBLE)",
"is_high_res": "width >= 512 AND height >= 512",
})
If the values you want to attach already live in another table (offline labels, classifier predictions, aesthetic scores), merge them in by joining on the key column:
import pyarrow as pa
labels = pa.table({
"key": pa.array([0, 1, 2]),
"aesthetic_score": pa.array([7.1, 6.4, 8.9]),
})
tbl.merge(labels, on="key")
The original columns and indices are untouched, so existing code that does not reference the new columns continues to work unchanged. New columns become visible to every reader as soon as the operation commits. For column values that require a Python computation (e.g., running an embedding model over the image bytes), Lance provides a batch-UDF API in the underlying library — see the Lance data evolution docs for that pattern.
Train
Projection lets a training loop read only the columns each step actually needs. LanceDB tables expose this through Permutation.identity(tbl).select_columns([...]), which plugs straight into the standard torch.utils.data.DataLoader so prefetch, shuffling, and batching behave as in any PyTorch pipeline. Columns added in the Evolve section above cost nothing per batch until they are explicitly projected.
import lancedb
from lancedb.permutation import Permutation
from torch.utils.data import DataLoader
db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
tbl = db.open_table("train")
train_ds = Permutation.identity(tbl).select_columns(["image", "caption"])
loader = DataLoader(train_ds, batch_size=256, shuffle=True, num_workers=4)
for batch in loader:
# batch carries only the projected columns; img_emb / img_emb_dinov3 stay on disk.
# decode the JPEG bytes, tokenize the captions, forward, backward...
...
Switching feature sets is a configuration change: passing ["img_emb_dinov3", "caption"] to select_columns(...) on the next run reads only those columns, with no data movement or shard reorganization.
Versioning
Every mutation to a Lance dataset, whether it adds a column, merges labels, or builds an index, commits a new version. Previous versions remain intact on disk. You can list versions and inspect the history directly from the Hub copy; creating new tags requires a local copy since tags are writes.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
tbl = db.open_table("train")
print("Current version:", tbl.version)
print("History:", tbl.list_versions())
print("Tags:", tbl.tags.list())
Once you have a local copy, tag a version for reproducibility:
local_db = lancedb.connect("./laion-1m/data")
local_tbl = local_db.open_table("train")
local_tbl.tags.create("aesthetic-v1", local_tbl.version)
A tagged version can be opened by name, or any version reopened by its number, against either the Hub copy or a local one:
tbl_v1 = db.open_table("train", version="aesthetic-v1")
tbl_v5 = db.open_table("train", version=5)
Pinning supports two workflows. A retrieval system locked to aesthetic-v1 keeps returning stable results while the dataset evolves in parallel; newly added columns or labels do not change what the tag resolves to. A training experiment pinned to the same tag can be rerun later against the exact same data, so changes in metrics reflect model changes rather than data drift. Neither workflow needs shadow copies or external manifest tracking.
Materialize a subset
Reads from the Hub are lazy, so exploratory queries only transfer the columns and row groups they touch. Mutating operations (Evolve, tag creation) need a writable backing store, and a training loop benefits from a local copy with fast random access. Both can be served by a subset of the dataset rather than the full corpus. The pattern is to stream a filtered query through .to_batches() into a new local table; only the projected columns and matching row groups cross the wire, and the bytes never fully materialize in Python memory.
import lancedb
remote_db = lancedb.connect("hf://datasets/lance-format/laion-1m/data")
remote_tbl = remote_db.open_table("train")
batches = (
remote_tbl.search()
.where('"NSFW" = 0 AND similarity > 0.35 AND width >= 512')
.select(["key", "image", "caption", "url", "img_emb"])
.to_batches()
)
local_db = lancedb.connect("./laion-subset")
local_db.create_table("train", batches)
The resulting ./laion-subset is a first-class LanceDB database. Every snippet in the Evolve, Train, and Versioning sections above works against it by swapping hf://datasets/lance-format/laion-1m/data for ./laion-subset.
Citation
@article{schuhmann2022laion5b,
title={LAION-5B: An open large-scale dataset for training next generation image-text models},
author={Schuhmann, Christoph and others},
journal={NeurIPS Datasets and Benchmarks Track},
year={2022}
}
License
Content inherits LAION's original licensing and safety guidelines. Review LAION policy before downstream use.
- Downloads last month
- 353