Datasets:
id int64 0 5k | image imagewidth (px) 200 640 | image_id stringlengths 2 6 | filename stringlengths 16 16 | captions listlengths 5 7 | caption stringlengths 30 138 | image_emb list | text_emb list |
|---|---|---|---|---|---|---|---|
0 | 38 | 000000179765.jpg | [
"A black Honda motorcycle parked in front of a garage.",
"A Honda motorcycle parked in a grass driveway",
"A black Honda motorcycle with a dark burgundy seat.",
"Ma motorcycle parked on the gravel in front of a garage",
"A motorcycle with its brake extended standing outside"
] | A black Honda motorcycle parked in front of a garage. | [
-0.0203704833984375,
-0.1126708984375,
0.002735137939453125,
-0.005603790283203125,
-0.03448486328125,
0.0124053955078125,
-0.004077911376953125,
-0.0012073516845703125,
0.037933349609375,
0.066650390625,
-0.043731689453125,
0.00951385498046875,
-0.02099609375,
-0.030609130859375,
0.0398... | [
0.027130126953125,
-0.07635498046875,
0.06671142578125,
-0.09283447265625,
0.02606201171875,
-0.0034084320068359375,
-0.0190582275390625,
-0.014678955078125,
0.02374267578125,
0.0631103515625,
-0.048126220703125,
0.019439697265625,
0.031829833984375,
-0.020477294921875,
0.094970703125,
... | |
1 | 401 | 000000190236.jpg | [
"An office cubicle with four different types of computers.",
"The home office space seems to be very cluttered.",
"an office with desk computer and chair and laptop.",
"Office setting with a lot of computer screens.",
"A desk and chair in an office cubicle."
] | An office cubicle with four different types of computers. | [
0.00457000732421875,
0.08441162109375,
0.016754150390625,
-0.0211639404296875,
0.0007762908935546875,
0.0067901611328125,
-0.029998779296875,
-0.0294342041015625,
0.01898193359375,
0.0193328857421875,
0.0550537109375,
-0.011199951171875,
-0.0119171142578125,
0.004352569580078125,
-0.0268... | [
0.0350341796875,
-0.0139007568359375,
0.042724609375,
0.0099334716796875,
0.0177001953125,
0.0044403076171875,
-0.043487548828125,
-0.005611419677734375,
-0.004009246826171875,
-0.017608642578125,
0.006256103515625,
-0.0306549072265625,
0.0179901123046875,
-0.03155517578125,
0.0202484130... | |
2 | 441 | 000000331352.jpg | [
"A small closed toilet in a cramped space.",
"A tan toilet and sink combination in a small room.",
"This is an advanced toilet with a sink and control panel.",
"A close-up picture of a toilet with a fountain.",
"Off white toilet with a faucet and controls. "
] | A small closed toilet in a cramped space. | [
0.0028896331787109375,
0.0025348663330078125,
-0.031158447265625,
0.06689453125,
0.02593994140625,
0.01355743408203125,
-0.01308441162109375,
0.03558349609375,
0.00003266334533691406,
0.00801849365234375,
-0.06903076171875,
-0.0325927734375,
-0.0029850006103515625,
0.00928497314453125,
-... | [
0.0703125,
-0.0019216537475585938,
0.052337646484375,
0.04461669921875,
0.04278564453125,
0.0263671875,
-0.01032257080078125,
0.01143646240234375,
-0.0228271484375,
0.0252838134765625,
-0.0255126953125,
-0.011871337890625,
0.00921630859375,
0.015716552734375,
-0.047943115234375,
-0.001... | |
3 | 447 | 000000517069.jpg | [
"Two women waiting at a bench next to a street.",
"A woman sitting on a bench and a woman standing waiting for the bus.",
"A woman sitting on a bench in the middle of the city",
"A woman sitting on a bench and a woman standing behind the bench at a bus stop",
"A woman and another woman waiting at a stop."
] | Two women waiting at a bench next to a street. | [
-0.0079193115234375,
0.11749267578125,
-0.1387939453125,
0.08599853515625,
0.002613067626953125,
-0.0161895751953125,
0.044677734375,
-0.0435791015625,
0.001735687255859375,
0.002422332763671875,
0.039337158203125,
0.0115203857421875,
-0.00537109375,
0.006824493408203125,
0.0244598388671... | [
0.0426025390625,
0.00830841064453125,
0.0989990234375,
0.125244140625,
0.004150390625,
0.0211639404296875,
-0.04425048828125,
-0.0758056640625,
0.0137481689453125,
0.0005955696105957031,
-0.01203155517578125,
0.0242767333984375,
-0.01020050048828125,
-0.0264739990234375,
-0.0136032104492... | |
4 | 856 | 000000182417.jpg | [
"A beautiful dessert waiting to be shared by two people",
"There is a piece of cake on a plate with decorations on it.",
"Creamy cheesecake dessert with whip cream and caramel.",
"An extravagant dessert on a plate overlooking the water.",
"This is a picture of an extremely fancy desert."
] | A beautiful dessert waiting to be shared by two people | [
-0.06353759765625,
0.10516357421875,
-0.064697265625,
0.080810546875,
-0.0205230712890625,
-0.02203369140625,
-0.007602691650390625,
-0.006923675537109375,
0.0185546875,
0.006534576416015625,
-0.04888916015625,
0.017730712890625,
-0.01348876953125,
0.0684814453125,
0.01904296875,
-0.01... | [
-0.0136871337890625,
0.06939697265625,
0.0268707275390625,
0.0819091796875,
-0.011077880859375,
-0.0106048583984375,
-0.01485443115234375,
-0.01496124267578125,
-0.0166778564453125,
0.00034427642822265625,
-0.0498046875,
-0.0074615478515625,
-0.0012845993041992188,
-0.00215911865234375,
... | |
5 | 1158 | 000000046378.jpg | [
"A cat eating a bird it has caught.",
"A white cat caught a bird outside on a patio.",
"Grey house cat devours a song bird on a door step",
"A long haired cat eating a dead bird.",
"A cat eating a dead bird on the ground."
] | A cat eating a bird it has caught. | [
-0.00046634674072265625,
0.1083984375,
-0.09954833984375,
0.04229736328125,
-0.060302734375,
-0.0187835693359375,
0.019561767578125,
0.0007672309875488281,
0.025482177734375,
-0.047149658203125,
-0.03887939453125,
0.0172882080078125,
0.0252685546875,
-0.03082275390625,
0.030364990234375,... | [
0.01465606689453125,
0.01175689697265625,
0.0019407272338867188,
0.042327880859375,
-0.03143310546875,
0.0234222412109375,
0.012847900390625,
-0.0175323486328125,
-0.022308349609375,
-0.060028076171875,
-0.0670166015625,
-0.0138702392578125,
0.0014486312866210938,
0.0312042236328125,
0.0... | |
6 | 1437 | 000000093437.jpg | [
"A shot of an elderly man inside a kitchen.",
"An old man is wearing an odd hat",
"An older man is wearing a funny hat in his dining room.",
"A man in a jacket and hat looks at the camera.",
"An old man standing in a kitchen posing for a picture."
] | A shot of an elderly man inside a kitchen. | [
-0.038970947265625,
0.09771728515625,
-0.03302001953125,
0.0272064208984375,
-0.0265045166015625,
-0.009979248046875,
-0.0008263587951660156,
-0.00516510009765625,
0.035247802734375,
0.003246307373046875,
0.024688720703125,
-0.050140380859375,
-0.010467529296875,
-0.0028476715087890625,
... | [
-0.0240325927734375,
-0.0021419525146484375,
0.0328369140625,
0.006381988525390625,
0.00475311279296875,
-0.00518035888671875,
-0.044464111328125,
-0.006938934326171875,
-0.033233642578125,
-0.013427734375,
-0.0231781005859375,
0.00246429443359375,
0.01120758056640625,
0.030487060546875,
... | |
7 | 1536 | 000000172330.jpg | [
"A cat in between two cars in a parking lot.",
"A cat stands between two parked cars on a grassy sidewalk. ",
"A cat at attention between two parked cars.",
"A grey and white cat watches from between parked cars.",
"A grey and white cat standing in the grass in a parking lot. "
] | A cat in between two cars in a parking lot. | [
0.0306854248046875,
0.083740234375,
-0.097900390625,
0.049407958984375,
-0.0026340484619140625,
0.05108642578125,
0.007602691650390625,
-0.033843994140625,
0.005519866943359375,
0.01514434814453125,
0.00559234619140625,
-0.03125,
0.023681640625,
0.0160980224609375,
-0.02557373046875,
0... | [
-0.0257568359375,
-0.04046630859375,
0.0266876220703125,
-0.0168304443359375,
0.0247039794921875,
0.0623779296875,
0.0271759033203125,
-0.004077911376953125,
-0.017730712890625,
-0.005039215087890625,
-0.05010986328125,
0.015594482421875,
0.021240234375,
-0.037017822265625,
0.03543090820... | |
8 | 1638 | 000000472678.jpg | [
"An office cubicle with multiple computers in it",
"An office desk with two flat panel monitors.",
"An office desk with two computer screens, books diagrams and a phone on it.",
"Two computer monitors are placed beside each other on a desk.",
"A desk with two monitors depicting security cameras."
] | An office cubicle with multiple computers in it | [
-0.018096923828125,
0.0268402099609375,
0.0006690025329589844,
-0.033782958984375,
-0.00661468505859375,
0.0008416175842285156,
-0.029327392578125,
-0.048248291015625,
-0.0250396728515625,
-0.028961181640625,
0.0259552001953125,
0.011993408203125,
0.018768310546875,
0.04290771484375,
-0.... | [
0.0640869140625,
-0.01226043701171875,
0.01995849609375,
-0.0189666748046875,
0.029876708984375,
-0.0081939697265625,
-0.041595458984375,
-0.007190704345703125,
-0.0050201416015625,
-0.00835418701171875,
0.038726806640625,
-0.01215362548828125,
0.0162506103515625,
-0.037994384765625,
0.0... | |
9 | 1879 | 000000314251.jpg | [
"A parade of motorcycles is going through a group of tall trees.",
"A group of motorcyclists drive down a tree lined street.",
"A group of motorcycles down a long street filled with trees on either side.",
"A group of people riding mopeds through a park.",
"A group of scooters rides down a street"
] | A parade of motorcycles is going through a group of tall trees. | [
0.0419921875,
0.0908203125,
-0.126953125,
-0.013153076171875,
-0.0037555694580078125,
0.0013942718505859375,
0.004970550537109375,
-0.038604736328125,
0.00722503662109375,
0.01038360595703125,
-0.029266357421875,
-0.0227203369140625,
-0.0111541748046875,
0.036376953125,
0.008827209472656... | [
0.041290283203125,
-0.012481689453125,
-0.04840087890625,
-0.012664794921875,
0.00756072998046875,
-0.034088134765625,
-0.0257568359375,
0.02130126953125,
-0.003276824951171875,
-0.058929443359375,
-0.0307159423828125,
-0.01271820068359375,
0.01168060302734375,
-0.0216522216796875,
0.051... |
COCO Captions 2017 (Lance Format)
Lance-formatted version of the COCO Captions 2017 corpus, redistributed via lmms-lab/COCO-Caption2017. Each row is one image with 5–7 human-written captions, CLIP image embedding, and CLIP text embedding of the canonical caption — all stored inline.
Splits
| Split | Rows |
|---|---|
val.lance |
5,000 (canonical COCO 2017 val set) |
test.lance |
40,700 |
The 2017 train split (118 k images, ~18 GB of source JPEGs) is intentionally not bundled here because the
lmms-lab/COCO-Caption2017redistribution does not include it. To extend with train, runcoco_captions_2017/dataprep.pyagainst your local COCO 2017 train mirror.
Schema
| Column | Type | Notes |
|---|---|---|
id |
int64 |
Row index within split |
image |
large_binary |
Inline JPEG bytes |
image_id |
string |
COCO image id |
filename |
string |
Original filename (e.g. 000000179765.jpg) |
captions |
list<string> |
All 5–7 captions |
caption |
string |
First caption — used as canonical text for FTS |
image_emb |
fixed_size_list<float32, 512> |
CLIP image embedding (cosine-normalized) |
text_emb |
fixed_size_list<float32, 512> |
CLIP text embedding of the canonical caption |
Pre-built indices
IVF_PQonimage_embandtext_emb—metric=cosineINVERTEDoncaptionBTREEonimage_id
Quick start
import lance
ds = lance.dataset("hf://datasets/lance-format/coco-captions-2017-lance/data/val.lance")
print(ds.count_rows(), ds.schema.names)
print(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/coco-captions-2017-lance/data")
tbl = db.open_table("val")
print(f"LanceDB table opened with {len(tbl)} image-caption pairs")
Tip — for production use, download locally first.
hf download lance-format/coco-captions-2017-lance --repo-type dataset --local-dir ./coco-captions-2017-lance
Vector search examples
Cross-modal text→image:
import lance, open_clip, pyarrow as pa, torch
model, _, _ = open_clip.create_model_and_transforms("ViT-B-32", pretrained="laion2b_s34b_b79k")
tokenizer = open_clip.get_tokenizer("ViT-B-32")
model = model.eval().cuda().half()
with torch.no_grad():
q = model.encode_text(tokenizer(["a giraffe eating leaves"]).cuda())
q = (q / q.norm(dim=-1, keepdim=True)).float().cpu().numpy()[0]
ds = lance.dataset("hf://datasets/lance-format/coco-captions-2017-lance/data/val.lance")
emb_field = ds.schema.field("image_emb")
hits = ds.scanner(
nearest={"column": "image_emb", "q": pa.array([q.tolist()], type=emb_field.type)[0], "k": 10},
columns=["image_id", "caption"],
).to_table().to_pylist()
LanceDB cross-modal text→image search
import lancedb, open_clip, torch
model, _, _ = open_clip.create_model_and_transforms("ViT-B-32", pretrained="laion2b_s34b_b79k")
tokenizer = open_clip.get_tokenizer("ViT-B-32")
model = model.eval().cuda().half()
with torch.no_grad():
q = model.encode_text(tokenizer(["a giraffe eating leaves"]).cuda())
q = (q / q.norm(dim=-1, keepdim=True)).float().cpu().numpy()[0]
db = lancedb.connect("hf://datasets/lance-format/coco-captions-2017-lance/data")
tbl = db.open_table("val")
results = (
tbl.search(q.tolist(), vector_column_name="image_emb")
.metric("cosine")
.select(["image_id", "caption"])
.limit(10)
.to_list()
)
Full-text search:
ds = lance.dataset("hf://datasets/lance-format/coco-captions-2017-lance/data/val.lance")
hits = ds.scanner(
full_text_query="surfer riding a wave",
columns=["image_id", "caption"],
limit=10,
).to_table().to_pylist()
LanceDB full-text search
import lancedb
db = lancedb.connect("hf://datasets/lance-format/coco-captions-2017-lance/data")
tbl = db.open_table("val")
results = (
tbl.search("surfer riding a wave")
.select(["image_id", "caption"])
.limit(10)
.to_list()
)
Why Lance?
- One dataset carries images + image embeddings + text embeddings + indices — no sidecar files.
- On-disk vector and full-text indices live next to the data, so search works on local copies and on the Hub.
- Schema evolution: add columns (new captions, alternate embeddings, model predictions) without rewriting the data.
Source & license
Converted from lmms-lab/COCO-Caption2017. Original COCO 2017 annotations are released under CC BY 4.0; the underlying images are subject to Flickr terms of service. Please review the COCO Terms of Use before redistribution.
Citation
@inproceedings{lin2014microsoft,
title={Microsoft COCO: Common objects in context},
author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence},
booktitle={European Conference on Computer Vision (ECCV)},
year={2014},
}
- Downloads last month
- 52