Documentation Index
Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
Use this file to discover all available pages before exploring further.
View on Hugging Face
Source dataset card and downloadable files for lance-format/stanford-cars-lance.
Lance-formatted version of the Stanford Cars dataset — 8,144 training images across 196 fine-grained car make/model/year classes — sourced from Multimodal-Fatima/StanfordCars_train.
Schema
| Column | Type | Notes |
|---|
id | int64 | Row index |
image | large_binary | Inline JPEG bytes |
label | int32 | Class id (0-195) |
blip_caption | string? | BLIP-generated caption (beam=5) carried through from the source mirror |
image_emb | fixed_size_list<float32, 512> | OpenCLIP ViT-B-32 embedding (cosine-normalized) |
Pre-built indices
IVF_PQ on image_emb — metric=cosine
INVERTED (FTS) on blip_caption
BTREE on label
Quick start
import lance
ds = lance.dataset("hf://datasets/lance-format/stanford-cars-lance/data/train.lance")
print(ds.count_rows(), ds.schema.names, ds.list_indices())
Load with LanceDB
These tables can also be consumed by LanceDB, the multimodal lakehouse and embedded search library built on top of Lance, for simplified vector search and other queries.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/stanford-cars-lance/data")
tbl = db.open_table("train")
print(f"LanceDB table opened with {len(tbl)} car images")
Caption-based filtering
import lance
ds = lance.dataset("hf://datasets/lance-format/stanford-cars-lance/data/train.lance")
hits = ds.scanner(full_text_query="red sports car", columns=["id", "blip_caption"], limit=10).to_table()
LanceDB full-text search
import lancedb
db = lancedb.connect("hf://datasets/lance-format/stanford-cars-lance/data")
tbl = db.open_table("train")
results = (
tbl.search("red sports car")
.select(["id", "blip_caption"])
.limit(10)
.to_list()
)
Visual similarity search
import lance, pyarrow as pa
ds = lance.dataset("hf://datasets/lance-format/stanford-cars-lance/data/train.lance")
emb_field = ds.schema.field("image_emb")
ref = ds.take([0], columns=["image_emb", "blip_caption"]).to_pylist()[0]
neighbors = ds.scanner(
nearest={"column": "image_emb", "q": pa.array([ref["image_emb"]], type=emb_field.type)[0], "k": 5},
columns=["id", "blip_caption"],
).to_table().to_pylist()
LanceDB visual similarity search
import lancedb
db = lancedb.connect("hf://datasets/lance-format/stanford-cars-lance/data")
tbl = db.open_table("train")
ref = tbl.search().limit(1).select(["image_emb", "blip_caption"]).to_list()[0]
query_embedding = ref["image_emb"]
results = (
tbl.search(query_embedding)
.metric("cosine")
.select(["id", "blip_caption"])
.limit(5)
.to_list()
)
Source & license
Converted from Multimodal-Fatima/StanfordCars_train, itself a parquet redistribution of the Stanford Cars test split. The original dataset license is for non-commercial research use; review the Stanford Cars terms before redistribution.
Citation
@inproceedings{krause2013collecting,
title={Collecting a large-scale dataset of fine-grained cars},
author={Krause, Jonathan and Stark, Michael and Deng, Jia and Fei-Fei, Li},
booktitle={Workshop on Fine-Grained Visual Categorization (CVPR)},
year={2013}
}