Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
id
int64
0
23k
image
imagewidth (px)
130
2.2k
segmentation
imagewidth (px)
130
2.2k
instance
imagewidth (px)
130
2.2k
filename
stringlengths
22
22
scene
listlengths
3
5
object_names
listlengths
2
289
objects_present
listlengths
1
69
num_objects
int32
2
289
image_emb
list
0
ADE_train_00001472.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "wall", "windowpane, window", "podium", "altar, communion table, Lord's table", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window" ]
[ "altar, communion table, Lord's table", "podium", "wall", "windowpane, window" ]
8
[ -0.005748748779296875, 0.1473388671875, -0.0209503173828125, -0.01007843017578125, 0.03973388671875, -0.0570068359375, -0.02386474609375, -0.0024394989013671875, 0.0227508544921875, 0.07037353515625, -0.0084991455078125, -0.0179290771484375, -0.040191650390625, -0.0499267578125, -0.00182...
1
ADE_train_00001473.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "ceiling", "vault", "wall", "wall", "wall", "column, pillar", "column, pillar", "wall", "floor, flooring", "bench", "seat", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "capital", "shaft", "base" ]
[ "base", "bench", "capital", "ceiling", "column, pillar", "floor, flooring", "seat", "shaft", "vault", "wall", "windowpane, window" ]
19
[ 0.04876708984375, 0.162109375, -0.142578125, -0.00043487548828125, -0.0310211181640625, -0.016632080078125, -0.00785064697265625, 0.031402587890625, 0.025146484375, 0.0041656494140625, 0.006259918212890625, 0.01554107666015625, -0.014678955078125, -0.10980224609375, 0.00821685791015625, ...
2
ADE_train_00001474.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "windowpane, window", "windowpane, window", "wall", "wall", "wall", "wall", "wall", "wall", "cross" ]
[ "cross", "vault", "wall", "windowpane, window" ]
10
[ 0.05218505859375, 0.1923828125, -0.1212158203125, 0.00167083740234375, -0.00392913818359375, -0.0261993408203125, -0.018096923828125, 0.085205078125, 0.007312774658203125, 0.0809326171875, 0.034393310546875, -0.015899658203125, -0.00513458251953125, -0.037384033203125, 0.0253143310546875...
3
ADE_train_00001475.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "stairway, staircase", "altar, communion table, Lord's table" ]
[ "altar, communion table, Lord's table", "stairway, staircase", "vault", "wall", "windowpane, window" ]
9
[ 0.031005859375, 0.0218353271484375, -0.057342529296875, 0.023712158203125, 0.0016183853149414062, -0.036865234375, 0.01337432861328125, 0.072998046875, 0.0277099609375, 0.05279541015625, 0.01287841796875, 0.035736083984375, -0.03350830078125, -0.12109375, -0.0098114013671875, 0.0146102...
4
ADE_train_00001476.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "altar, communion table, Lord's table", "wall", "wall", "stairway, staircase", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window", "windowpane, window" ]
[ "altar, communion table, Lord's table", "stairway, staircase", "vault", "wall", "windowpane, window" ]
13
[ 0.02545166015625, 0.1771240234375, -0.1446533203125, 0.00913238525390625, 0.00849151611328125, -0.00809478759765625, -0.0216217041015625, 0.0531005859375, 0.020660400390625, 0.0697021484375, 0.0286102294921875, 0.0188751220703125, 0.004924774169921875, -0.1026611328125, -0.01629638671875...
5
ADE_train_00001477.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "altar, communion table, Lord's table", "railing, rail", "railing, rail", "windowpane, window", "windowpane, window", "windowpane, window", "floor, flooring", "stairs, steps", "wall", "bench", "bench", "railing, rail", "railing, rail", "bench", "lamp", "lamp" ]
[ "altar, communion table, Lord's table", "bench", "floor, flooring", "lamp", "railing, rail", "stairs, steps", "vault", "wall", "windowpane, window" ]
18
[ 0.043426513671875, 0.1959228515625, 0.0023365020751953125, -0.0341796875, -0.000640869140625, -0.07769775390625, 0.0052032470703125, 0.0280609130859375, 0.01312255859375, 0.0052490234375, 0.050201416015625, 0.01275634765625, -0.003448486328125, -0.018890380859375, 0.032623291015625, 0....
6
ADE_train_00001478.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "wall", "wall", "wall", "wall", "windowpane, window", "windowpane, window", "windowpane, window", "wall" ]
[ "vault", "wall", "windowpane, window" ]
10
[ 0.031890869140625, 0.160400390625, -0.06402587890625, 0.040130615234375, 0.01153564453125, 0.01023101806640625, -0.0020198822021484375, 0.0474853515625, 0.032196044921875, 0.04168701171875, 0.006717681884765625, 0.0078582763671875, 0.0001977682113647461, -0.07208251953125, -0.02421569824...
7
ADE_train_00001479.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "wall", "ceiling", "wall", "wall", "mezzanine, first balcony", "door", "mezzanine, first balcony", "wall" ]
[ "ceiling", "door", "mezzanine, first balcony", "wall" ]
8
[ 0.041259765625, 0.1661376953125, -0.158935546875, 0.043975830078125, -0.029205322265625, -0.01218414306640625, -0.032318115234375, 0.017364501953125, 0.0252227783203125, 0.0858154296875, -0.00579071044921875, 0.01276397705078125, 0.00010055303573608398, -0.07147216796875, -0.002292633056...
8
ADE_train_00001480.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "wall", "wall", "windowpane, window", "windowpane, window", "windowpane, window", "cross", "plant, flora, plant life", "wall" ]
[ "cross", "plant, flora, plant life", "vault", "wall", "windowpane, window" ]
10
[ 0.01885986328125, 0.181396484375, -0.06304931640625, -0.023193359375, 0.00885772705078125, -0.047821044921875, 0.01265716552734375, 0.058197021484375, 0.032012939453125, -0.00472259521484375, 0.050628662109375, -0.016265869140625, -0.038421630859375, -0.06640625, -0.015106201171875, 0....
9
ADE_train_00001481.jpg
[ "indoor", "cultural", "apse indoor" ]
[ "vault", "wall", "altar, communion table, Lord's table", "column, pillar", "candle, taper, wax light", "column, pillar", "candle, taper, wax light", "wall", "wall", "wall", "sculpture", "pulpit", "bench", "bench", "floor, flooring", "column, pillar", "column, pillar", "candelabrum,...
[ "altar, communion table, Lord's table", "bench", "candelabrum, candelabra", "candle, taper, wax light", "column, pillar", "floor, flooring", "pulpit", "sculpture", "vault", "wall" ]
19
[ 0.038177490234375, 0.2137451171875, -0.181396484375, 0.034698486328125, 0.009246826171875, -0.0248870849609375, -0.00449371337890625, 0.04486083984375, 0.03387451171875, 0.0199432373046875, 0.0291748046875, 0.0274658203125, 0.00083160400390625, -0.0633544921875, 0.006084442138671875, 0...
10
ADE_frame_00000007.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "plant, flora, plant life", "floor, flooring", "person, individual, someone, somebody, mortal, soul", "head", "eye", "eye", "mouth", "right arm", "right hand", "left arm", "left hand", "right leg", "right foot", "left leg", "left foot", "signboar...
[ "aquarium, fish tank, marine museum", "back", "eye", "floor, flooring", "hair", "head", "left arm", "left foot", "left hand", "left leg", "mouth", "person, individual, someone, somebody, mortal, soul", "plant, flora, plant life", "right arm", "right foot", "right hand", "right leg", ...
26
[ 0.07940673828125, 0.1783447265625, -0.01300048828125, -0.0184478759765625, -0.006786346435546875, -0.01873779296875, 0.035614013671875, 0.0301513671875, 0.00888824462890625, -0.09423828125, 0.0036983489990234375, -0.039306640625, -0.0377197265625, 0.00766754150390625, 0.00262832641601562...
11
ADE_train_00001488.jpg
[ "indoor", "cultural", "aquarium" ]
[ "ceiling", "wall", "aquarium, fish tank, marine museum", "fence, fencing", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "pers...
[ "aquarium, fish tank, marine museum", "ceiling", "fence, fencing", "fish", "person, individual, someone, somebody, mortal, soul", "plant, flora, plant life", "rock, stone", "text, textual matter", "wall" ]
23
[ 0.043609619140625, -0.0308837890625, -0.11798095703125, -0.045318603515625, 0.01114654541015625, -0.024566650390625, -0.04425048828125, -0.056121826171875, 0.039825439453125, -0.1458740234375, 0.037353515625, -0.057220458984375, 0.00989532470703125, -0.0137176513671875, 0.05035400390625,...
12
ADE_train_00001489.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "person, individual, someone, somebody, mortal, soul", "floor, flooring", "fish", "fish", "fish", "fish" ]
[ "aquarium, fish tank, marine museum", "fish", "floor, flooring", "person, individual, someone, somebody, mortal, soul" ]
7
[ 0.0189208984375, 0.0338134765625, -0.1591796875, 0.042236328125, 0.0107269287109375, -0.0280914306640625, -0.053070068359375, 0.0185394287109375, -0.0152130126953125, -0.08056640625, 0.0195159912109375, -0.01806640625, 0.0282440185546875, 0.0199737548828125, -0.07781982421875, 0.054046...
13
ADE_train_00001490.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "wall", "wall", "gate", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "floor, flooring", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul",...
[ "aquarium, fish tank, marine museum", "fish", "floor, flooring", "gate", "person, individual, someone, somebody, mortal, soul", "wall" ]
12
[ 0.03228759765625, 0.0908203125, -0.1966552734375, 0.0419921875, 0.004199981689453125, -0.048583984375, -0.0428466796875, 0.0396728515625, -0.00914764404296875, -0.1209716796875, -0.00850677490234375, 0.000004291534423828125, 0.0031147003173828125, -0.061737060546875, -0.03948974609375, ...
14
ADE_train_00001491.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "ceiling", "wall", "column, pillar", "column, pillar", "gate", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "console", "person, individual, someone, somebody, mortal, soul", "person, individual...
[ "aquarium, fish tank, marine museum", "ceiling", "column, pillar", "console", "eye", "gate", "gaze", "head", "left arm", "left hand", "mouth", "neck", "person, individual, someone, somebody, mortal, soul", "right arm", "right hand", "wall" ]
31
[ -0.0228118896484375, 0.0040740966796875, -0.04168701171875, -0.00034308433532714844, 0.00977325439453125, 0.00433349609375, -0.01032257080078125, -0.029052734375, 0.0136260986328125, -0.050994873046875, -0.0247650146484375, -0.0439453125, -0.017822265625, 0.041656494140625, -0.0349426269...
15
ADE_train_00001492.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "wall", "wall", "floor, flooring", "fish", "fish", "fish", "fish", "fish", "fish" ]
[ "aquarium, fish tank, marine museum", "fish", "floor, flooring", "wall" ]
10
[ 0.010986328125, 0.064208984375, -0.160400390625, 0.057647705078125, 0.0060272216796875, -0.0255584716796875, -0.041656494140625, 0.00965118408203125, -0.00002658367156982422, -0.1356201171875, 0.033233642578125, 0.025299072265625, 0.035858154296875, -0.0484619140625, 0.01983642578125, ...
16
ADE_train_00001493.jpg
[ "indoor", "cultural", "aquarium" ]
[ "rock, stone", "aquarium, fish tank, marine museum", "fish", "wall", "person, individual, someone, somebody, mortal, soul" ]
[ "aquarium, fish tank, marine museum", "fish", "person, individual, someone, somebody, mortal, soul", "rock, stone", "wall" ]
5
[ 0.0034275054931640625, 0.0718994140625, -0.11419677734375, 0.033355712890625, -0.0203399658203125, 0.022857666015625, 0.022491455078125, 0.0174407958984375, -0.02386474609375, -0.0239715576171875, 0.00226593017578125, -0.031463623046875, -0.0183868408203125, -0.03839111328125, -0.0908203...
17
ADE_train_00001494.jpg
[ "indoor", "cultural", "aquarium" ]
[ "aquarium, fish tank, marine museum", "shark", "fish", "fish", "fish", "fish", "fish", "fish", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, somebody, mortal, soul", "person, individual, someone, some...
[ "aquarium, fish tank, marine museum", "fish", "person, individual, someone, somebody, mortal, soul", "shark" ]
21
[ 0.0259246826171875, 0.116455078125, -0.189453125, -0.017333984375, 0.00250244140625, -0.03564453125, -0.04644775390625, 0.025421142578125, 0.00910186767578125, -0.07733154296875, 0.0194549560546875, 0.002971649169921875, 0.021728515625, -0.03125, -0.0204010009765625, 0.0516357421875, ...
End of preview. Expand in Data Studio

ADE20K (Lance Format)

A Lance-formatted version of the full ADE20K scene parsing benchmark, sourced from 1aurent/ADE20K. Each row is one scene image with its inline JPEG bytes, a per-pixel semantic segmentation map encoded as PNG bytes, an optional instance map, scene class labels, the full per-polygon object-name list, an OpenCLIP image embedding, and pre-built indices — all available directly from the Hub at hf://datasets/lance-format/ade20k-lance/data.

Key features

  • Inline image and segmentation bytes — both the JPEG image and the RGB-encoded PNG segmentation map ride on the same row, so an annotated example is a single row read with no sidecar files.
  • Per-polygon object metadataobject_names keeps the full list (one entry per annotated polygon), objects_present is the deduped set used for class-presence filters, and num_objects is precomputed.
  • CLIP image embeddings (image_emb, OpenCLIP ViT-B/32, 512-d, cosine-normalized) for visual retrieval over scenes.
  • Indices shipped on diskIVF_PQ on image_emb, BTREE on num_objects, and LABEL_LIST on objects_present for fast array_has_any / array_has_all predicates.

Splits

Split Rows
train.lance 25,574
validation.lance 2,000

Schema

Column Type Notes
id int64 Row index within split
image large_binary Inline JPEG bytes
segmentation large_binary Inline PNG bytes — semantic segmentation map (RGB encoding per ADE20K spec)
instance large_binary? Inline PNG bytes — instance map; null if not provided
filename string ADE20K relative filename
scene list<string> Scene class labels (e.g. ["bathroom"])
object_names list<string> Per-polygon object names (one entry per polygon, not deduped)
objects_present list<string> Deduped object names — feeds the LABEL_LIST index
num_objects int32 Number of annotated objects
image_emb fixed_size_list<float32, 512> OpenCLIP ViT-B/32 image embedding (cosine-normalized)

Pre-built indices

  • IVF_PQ on image_emb — vector similarity search (cosine)
  • BTREE on num_objects — fast range filters on scene complexity
  • LABEL_LIST on objects_present — supports array_has_any / array_has_all for class-presence filtering

Why Lance?

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Versatile Querying: Supports combining vector similarity search, full-text search, and SQL-style filtering in a single query, accelerated by on-disk indexes.
  6. 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 when 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/ade20k-lance", split="validation", streaming=True)
for row in hf_ds.take(3):
    print(row["filename"], row["scene"], row["num_objects"])

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, Versioning, and Materialize-a-subset sections below.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/ade20k-lance/data")
tbl = db.open_table("validation")
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 dataset internals — schema, scanner, fragments, the list of pre-built indices.

import lance

ds = lance.dataset("hf://datasets/lance-format/ade20k-lance/data/validation.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, ANN search, and any mutation are far faster against a local copy:

hf download lance-format/ade20k-lance --repo-type dataset --local-dir ./ade20k-lance

Then point Lance or LanceDB at ./ade20k-lance/data.

Search

The bundled IVF_PQ index on image_emb makes approximate-nearest-neighbor scene retrieval a single call. In production you would encode a query image through the same OpenCLIP ViT-B/32 model used at ingest and pass the resulting 512-d vector to tbl.search(...). The example below uses the embedding stored on row 42 as a runnable stand-in, so the snippet works without loading any model.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/ade20k-lance/data")
tbl = db.open_table("validation")

seed = (
    tbl.search()
    .select(["image_emb", "filename", "scene"])
    .limit(1)
    .offset(42)
    .to_list()[0]
)

hits = (
    tbl.search(seed["image_emb"])
    .metric("cosine")
    .select(["filename", "scene", "objects_present"])
    .limit(10)
    .to_list()
)
print("query scene:", seed["scene"])
for r in hits:
    print(f"  {r['filename']}  scene={r['scene']}  objs={r['objects_present'][:5]}")

Because the embeddings are cosine-normalized, the first hit will typically be the source image itself — a useful sanity check. Tune nprobes and refine_factor to trade recall against latency for your workload.

Curate

Curation for a semantic-segmentation workflow usually means picking scenes that contain specific classes, possibly bounded by complexity. The LABEL_LIST index on objects_present makes class-presence predicates trivial, and Lance evaluates them inside the same scan as a structural filter on num_objects. The bounded .limit(500) keeps the result small and inspectable, and the segmentation blob is left out of the projection so the candidate scan is dominated by metadata, not PNG bytes.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/ade20k-lance/data")
tbl = db.open_table("validation")

candidates = (
    tbl.search()
    .where(
        "array_has_all(objects_present, ['bed', 'window']) AND num_objects >= 8",
        prefilter=True,
    )
    .select(["id", "filename", "scene", "objects_present", "num_objects"])
    .limit(500)
    .to_list()
)
print(f"{len(candidates)} candidates; first scene: {candidates[0]['scene']}")

The result is a plain list of dictionaries, ready to inspect, persist as a manifest of ids, or feed into the Evolve and Train workflows below. Swapping array_has_all for array_has_any widens the recall; replacing the structural predicate with num_objects BETWEEN 3 AND 6 selects simpler scenes for an ablation slice.

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 has_person flag and a scene_label string pulled out of the scene list, 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 download to pull the full corpus first.

import lancedb

db = lancedb.connect("./ade20k-lance/data")  # local copy required for writes
tbl = db.open_table("validation")

tbl.add_columns({
    "has_person": "array_has_any(objects_present, ['person'])",
    "scene_label": "element_at(scene, 1)",
    "complexity_bucket": "CASE WHEN num_objects < 5 THEN 'sparse' "
                        "WHEN num_objects < 15 THEN 'medium' ELSE 'dense' END",
})

If the values you want to attach already live in another table (offline panoptic ids, predictions from a baseline segmenter, a second-pass embedding), merge them in by joining on id:

import pyarrow as pa

predictions = pa.table({
    "id": pa.array([0, 1, 2], type=pa.int64()),
    "baseline_miou": pa.array([0.41, 0.55, 0.62]),
})
tbl.merge(predictions, on="id")

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., re-running a segmentation model over the image bytes), Lance provides a batch-UDF API — see the Lance data evolution docs.

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 prefetching, shuffling, and batching behave as in any PyTorch pipeline. For a semantic-segmentation run, project the JPEG bytes and the segmentation PNG bytes; both are decoded inside the training step. 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/ade20k-lance/data")
tbl = db.open_table("train")

train_ds = Permutation.identity(tbl).select_columns(["image", "segmentation"])
loader = DataLoader(train_ds, batch_size=8, shuffle=True, num_workers=4)

for batch in loader:
    # batch carries only the JPEG and PNG byte columns; decode both,
    # remap the ADE20K RGB-encoded mask to class ids, forward, loss...
    ...

Switching feature sets is a configuration change: passing ["image_emb", "objects_present"] to select_columns(...) on the next run skips JPEG and PNG decoding entirely and reads only the cached 512-d vectors plus the deduped class list, which is the right shape for training a lightweight scene classifier or a class-presence probe on top of frozen features.

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/ade20k-lance/data")
tbl = db.open_table("validation")

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("./ade20k-lance/data")
local_tbl = local_db.open_table("validation")
local_tbl.tags.create("segmenter-baseline-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("validation", version="segmenter-baseline-v1")
tbl_v5 = db.open_table("validation", version=5)

Pinning supports two workflows. A serving pipeline locked to segmenter-baseline-v1 keeps reading the exact same segmentation maps and class lists while the dataset evolves in parallel; newly merged predictions or evolved columns do not change what the tag resolves to. A training experiment pinned to the same tag can be rerun later against the exact same images, so changes in mIoU 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 split. 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/ade20k-lance/data")
remote_tbl = remote_db.open_table("train")

batches = (
    remote_tbl.search()
    .where("array_has_any(objects_present, ['bed', 'sofa', 'chair']) AND num_objects >= 5")
    .select(["id", "image", "segmentation", "filename", "scene",
             "objects_present", "num_objects", "image_emb"])
    .to_batches()
)

local_db = lancedb.connect("./ade20k-indoor-subset")
local_db.create_table("train", batches)

The resulting ./ade20k-indoor-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/ade20k-lance/data for ./ade20k-indoor-subset.

Source & license

Converted from 1aurent/ADE20K. ADE20K is released under the BSD 3-Clause license by the MIT CSAIL Computer Vision group.

Citation

@inproceedings{zhou2017scene,
  title={Scene Parsing through ADE20K Dataset},
  author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2017}
}
Downloads last month
148