ayushexel commited on
Commit
be6a498
·
verified ·
1 Parent(s): 5e0cdaa

Add files using upload-large-folder tool

Browse files
Files changed (39) hide show
  1. .gitattributes +9 -0
  2. README.md +151 -0
  3. data/train.lance/_indices/163211ff-b515-4509-b5ee-cb48f900a033/bitmap_page_lookup.lance +3 -0
  4. data/train.lance/_indices/36ffd807-e080-40cf-8535-b262c0dfb82a/page_data.lance +3 -0
  5. data/train.lance/_indices/36ffd807-e080-40cf-8535-b262c0dfb82a/page_lookup.lance +0 -0
  6. data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/auxiliary.idx +3 -0
  7. data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/index.idx +3 -0
  8. data/train.lance/_indices/c6298242-f5b2-499a-a0bf-1964d175532e/page_data.lance +3 -0
  9. data/train.lance/_indices/c6298242-f5b2-499a-a0bf-1964d175532e/page_lookup.lance +0 -0
  10. data/train.lance/_transactions/0-cb592a53-539e-40c9-9b5c-5a3eb9dc2992.txn +0 -0
  11. data/train.lance/_transactions/1-b8592296-c7d5-4729-bb75-e8203319ec2c.txn +0 -0
  12. data/train.lance/_transactions/2-dfa50343-f3c6-419b-83a6-a37fa18ea4b2.txn +0 -0
  13. data/train.lance/_transactions/3-8f727169-c0d0-4e8c-a2eb-45b0905afdf1.txn +0 -0
  14. data/train.lance/_transactions/4-2a2b1018-1565-4451-8b40-984e38bf233e.txn +0 -0
  15. data/train.lance/_versions/18446744073709551610.manifest +0 -0
  16. data/train.lance/_versions/18446744073709551611.manifest +0 -0
  17. data/train.lance/_versions/18446744073709551612.manifest +0 -0
  18. data/train.lance/_versions/18446744073709551613.manifest +0 -0
  19. data/train.lance/_versions/18446744073709551614.manifest +0 -0
  20. data/train.lance/data/101100110011001000011000afe5e54dd5a60a85392f8d9c29.lance +3 -0
  21. data/train.lance/data/11101001110011100010100046d0854986bc99d0a347d8fb4b.lance +3 -0
  22. data/val.lance/_indices/237b985c-d35e-4dd9-9085-d40b2fd89b7b/page_data.lance +0 -0
  23. data/val.lance/_indices/237b985c-d35e-4dd9-9085-d40b2fd89b7b/page_lookup.lance +0 -0
  24. data/val.lance/_indices/859bab32-5b3b-4f62-a571-4d92a3d23fcc/page_data.lance +0 -0
  25. data/val.lance/_indices/859bab32-5b3b-4f62-a571-4d92a3d23fcc/page_lookup.lance +0 -0
  26. data/val.lance/_indices/a0766726-3f80-47ad-a8a0-a4b131232b44/bitmap_page_lookup.lance +0 -0
  27. data/val.lance/_indices/d9972903-52a6-41c5-b8f0-2431f1610dfc/auxiliary.idx +3 -0
  28. data/val.lance/_indices/d9972903-52a6-41c5-b8f0-2431f1610dfc/index.idx +0 -0
  29. data/val.lance/_transactions/0-c93ed2b4-aa42-4f04-b033-e4a4bb00b40a.txn +0 -0
  30. data/val.lance/_transactions/1-f6de45e6-8488-44da-89e2-385245be4f24.txn +0 -0
  31. data/val.lance/_transactions/2-f05b54f2-9aea-46b1-94ab-185f0393c6cf.txn +0 -0
  32. data/val.lance/_transactions/3-5b39b9fd-8504-468e-86aa-e9b5373c0b69.txn +0 -0
  33. data/val.lance/_transactions/4-9d5a908c-fd15-4915-b54e-94a05e212f97.txn +0 -0
  34. data/val.lance/_versions/18446744073709551610.manifest +0 -0
  35. data/val.lance/_versions/18446744073709551611.manifest +0 -0
  36. data/val.lance/_versions/18446744073709551612.manifest +0 -0
  37. data/val.lance/_versions/18446744073709551613.manifest +0 -0
  38. data/val.lance/_versions/18446744073709551614.manifest +0 -0
  39. data/val.lance/data/0100001111001100000000000fef594f858dfb7f7a035a8f02.lance +3 -0
.gitattributes CHANGED
@@ -58,3 +58,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/index.idx filter=lfs diff=lfs merge=lfs -text
62
+ data/val.lance/_indices/d9972903-52a6-41c5-b8f0-2431f1610dfc/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
63
+ data/train.lance/_indices/c6298242-f5b2-499a-a0bf-1964d175532e/page_data.lance filter=lfs diff=lfs merge=lfs -text
64
+ data/train.lance/_indices/163211ff-b515-4509-b5ee-cb48f900a033/bitmap_page_lookup.lance filter=lfs diff=lfs merge=lfs -text
65
+ data/train.lance/_indices/36ffd807-e080-40cf-8535-b262c0dfb82a/page_data.lance filter=lfs diff=lfs merge=lfs -text
66
+ data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
67
+ data/val.lance/data/0100001111001100000000000fef594f858dfb7f7a035a8f02.lance filter=lfs diff=lfs merge=lfs -text
68
+ data/train.lance/data/101100110011001000011000afe5e54dd5a60a85392f8d9c29.lance filter=lfs diff=lfs merge=lfs -text
69
+ data/train.lance/data/11101001110011100010100046d0854986bc99d0a347d8fb4b.lance filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - object-detection
5
+ - image-feature-extraction
6
+ language:
7
+ - en
8
+ tags:
9
+ - coco
10
+ - coco-2017
11
+ - object-detection
12
+ - bounding-boxes
13
+ - lance
14
+ - clip-embeddings
15
+ pretty_name: coco-detection-2017-lance
16
+ size_categories:
17
+ - 100K<n<1M
18
+ ---
19
+ # COCO 2017 Object Detection (Lance Format)
20
+
21
+ Lance-formatted version of the [COCO 2017 object detection benchmark](https://cocodataset.org/) — sourced from [`detection-datasets/coco`](https://huggingface.co/datasets/detection-datasets/coco) — with **123,287 images** and the full per-image list of bounding boxes, category labels, and CLIP image embeddings, all stored inline.
22
+
23
+ ## Why this version?
24
+
25
+ Object detection datasets typically split images, annotations, and embeddings across multiple files (often three different formats: JPEG, JSON, NumPy). Lance keeps all of it in one tabular dataset:
26
+
27
+ - one row per image,
28
+ - the JPEG bytes, the bounding box list, the category labels, and the CLIP image embedding all live as columns on the same row,
29
+ - `IVF_PQ` on the embedding column lets you do visual similarity search without leaving the dataset, and `LABEL_LIST` on `categories_present` lets you filter to "images containing a dog and a frisbee" in milliseconds.
30
+
31
+ ## Splits
32
+
33
+ | Split | Rows |
34
+ |-------|------|
35
+ | `train.lance` | 117,000+ |
36
+ | `val.lance` | 4,950+ |
37
+
38
+ (Counts come from the `detection-datasets/coco` redistribution; box counts: ~860k train / ~37k val.)
39
+
40
+ ## Schema
41
+
42
+ | Column | Type | Notes |
43
+ |---|---|---|
44
+ | `id` | `int64` | Row index within split |
45
+ | `image` | `large_binary` | Inline JPEG bytes |
46
+ | `image_id` | `int64` | COCO image id |
47
+ | `width`, `height` | `int32` | Image dimensions in pixels |
48
+ | `bboxes` | `list<list<float32, 4>>` | Each box is `[x_min, y_min, x_max, y_max]` in absolute pixel coords |
49
+ | `categories` | `list<int32>` | COCO 80-class id (0-79) |
50
+ | `category_names` | `list<string>` | Human-readable class name per object (e.g. `person`, `dog`, …) |
51
+ | `areas` | `list<float32>` | Bounding-box area (pixels²) |
52
+ | `num_objects` | `int32` | Number of annotated objects in the image |
53
+ | `categories_present` | `list<string>` | Deduped class names — feeds the `LABEL_LIST` index for fast filtering |
54
+ | `image_emb` | `fixed_size_list<float32, 512>` | OpenCLIP `ViT-B-32` image embedding (cosine-normalized) |
55
+
56
+ ## Pre-built indices
57
+
58
+ - `IVF_PQ` on `image_emb` — `metric=cosine`
59
+ - `BTREE` on `image_id`, `num_objects`
60
+ - `LABEL_LIST` on `categories_present` — supports `array_has_any` / `array_has_all` predicates
61
+
62
+ ## Quick start
63
+
64
+ ```python
65
+ import lance
66
+
67
+ ds = lance.dataset("hf://datasets/lance-format/coco-detection-2017-lance/data/val.lance")
68
+ print(ds.count_rows(), ds.schema.names, ds.list_indices())
69
+ ```
70
+
71
+ > **Tip — for production use, download locally first.**
72
+ > ```bash
73
+ > hf download lance-format/coco-detection-2017-lance --repo-type dataset --local-dir ./coco-detection-2017-lance
74
+ > ```
75
+
76
+ ## Read one annotated image
77
+
78
+ ```python
79
+ import io
80
+ import lance
81
+ from PIL import Image, ImageDraw
82
+
83
+ ds = lance.dataset("hf://datasets/lance-format/coco-detection-2017-lance/data/val.lance")
84
+ row = ds.take([0], columns=["image", "bboxes", "category_names", "width", "height"]).to_pylist()[0]
85
+
86
+ img = Image.open(io.BytesIO(row["image"])).convert("RGB")
87
+ draw = ImageDraw.Draw(img)
88
+ for (x1, y1, x2, y2), name in zip(row["bboxes"], row["category_names"]):
89
+ draw.rectangle([x1, y1, x2, y2], outline="red", width=3)
90
+ draw.text((x1 + 4, y1 + 4), name, fill="red")
91
+ img.save("annotated.jpg")
92
+ ```
93
+
94
+ ## Filter by classes (LABEL_LIST index)
95
+
96
+ ```python
97
+ import lance
98
+ ds = lance.dataset("hf://datasets/lance-format/coco-detection-2017-lance/data/val.lance")
99
+
100
+ # Images that contain BOTH a person and a frisbee.
101
+ rows = ds.scanner(
102
+ filter="array_has_all(categories_present, ['person', 'frisbee'])",
103
+ columns=["image_id", "category_names"],
104
+ limit=10,
105
+ ).to_table().to_pylist()
106
+
107
+ # Images with at least 5 objects of any class.
108
+ busy = ds.scanner(
109
+ filter="num_objects >= 5",
110
+ columns=["image_id", "num_objects"],
111
+ limit=10,
112
+ ).to_table().to_pylist()
113
+ ```
114
+
115
+ ## Visual similarity search
116
+
117
+ ```python
118
+ import lance
119
+ import pyarrow as pa
120
+
121
+ ds = lance.dataset("hf://datasets/lance-format/coco-detection-2017-lance/data/val.lance")
122
+ emb_field = ds.schema.field("image_emb")
123
+ ref = ds.take([0], columns=["image_emb"]).to_pylist()[0]["image_emb"]
124
+ query = pa.array([ref], type=emb_field.type)
125
+
126
+ neighbors = ds.scanner(
127
+ nearest={"column": "image_emb", "q": query[0], "k": 5},
128
+ columns=["image_id", "category_names"],
129
+ ).to_table().to_pylist()
130
+ ```
131
+
132
+ ## Why Lance?
133
+
134
+ - One dataset carries images + boxes + categories + areas + embeddings + indices — no JSON sidecars.
135
+ - On-disk vector and label-list indices live next to the data, so filters and ANN search work on local copies and on the Hub.
136
+ - Schema evolution: add columns (segmentation polygons, keypoints, panoptic ids, fresh embeddings) without rewriting the data.
137
+
138
+ ## Source & license
139
+
140
+ Converted from [`detection-datasets/coco`](https://huggingface.co/datasets/detection-datasets/coco). COCO annotations are released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); the underlying images are subject to Flickr terms of service. See the [COCO Terms of Use](https://cocodataset.org/#termsofuse) before redistribution.
141
+
142
+ ## Citation
143
+
144
+ ```
145
+ @inproceedings{lin2014microsoft,
146
+ title={Microsoft COCO: Common objects in context},
147
+ 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},
148
+ booktitle={European Conference on Computer Vision (ECCV)},
149
+ year={2014}
150
+ }
151
+ ```
data/train.lance/_indices/163211ff-b515-4509-b5ee-cb48f900a033/bitmap_page_lookup.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa02f6d8a93e73b8a4c2e615080ba51510d62f9353462d19ffeae33a249d747a
3
+ size 569442
data/train.lance/_indices/36ffd807-e080-40cf-8535-b262c0dfb82a/page_data.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04797cf944f064062d4ac0287ee4420bbcc48c8f96d81b2f40f447b63b723995
3
+ size 576905
data/train.lance/_indices/36ffd807-e080-40cf-8535-b262c0dfb82a/page_lookup.lance ADDED
Binary file (1.71 kB). View file
 
data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:867b21bbfcb139d635b66d27bbc5543a940225d5d243380a0de566e5460926af
3
+ size 8537612
data/train.lance/_indices/9508865e-1566-42c6-a175-e0dcf5d527f8/index.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d14579fcaa846df801f33de92217af0a0eef3a7e8f32477d1669cd9efb97f2a
3
+ size 525898
data/train.lance/_indices/c6298242-f5b2-499a-a0bf-1964d175532e/page_data.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e21d4b4012925452668de8c169b10cc05601cc26edc5a5b145497b29f845c391
3
+ size 370318
data/train.lance/_indices/c6298242-f5b2-499a-a0bf-1964d175532e/page_lookup.lance ADDED
Binary file (1.47 kB). View file
 
data/train.lance/_transactions/0-cb592a53-539e-40c9-9b5c-5a3eb9dc2992.txn ADDED
Binary file (816 Bytes). View file
 
data/train.lance/_transactions/1-b8592296-c7d5-4729-bb75-e8203319ec2c.txn ADDED
Binary file (192 Bytes). View file
 
data/train.lance/_transactions/2-dfa50343-f3c6-419b-83a6-a37fa18ea4b2.txn ADDED
Binary file (198 Bytes). View file
 
data/train.lance/_transactions/3-8f727169-c0d0-4e8c-a2eb-45b0905afdf1.txn ADDED
Binary file (201 Bytes). View file
 
data/train.lance/_transactions/4-2a2b1018-1565-4451-8b40-984e38bf233e.txn ADDED
Binary file (197 Bytes). View file
 
data/train.lance/_versions/18446744073709551610.manifest ADDED
Binary file (1.72 kB). View file
 
data/train.lance/_versions/18446744073709551611.manifest ADDED
Binary file (1.57 kB). View file
 
data/train.lance/_versions/18446744073709551612.manifest ADDED
Binary file (1.41 kB). View file
 
data/train.lance/_versions/18446744073709551613.manifest ADDED
Binary file (1.25 kB). View file
 
data/train.lance/_versions/18446744073709551614.manifest ADDED
Binary file (1.72 kB). View file
 
data/train.lance/data/101100110011001000011000afe5e54dd5a60a85392f8d9c29.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61f0685f96a8501af76008d15ba9072c5fffbc37d0bec05a7f57e7ff5b369e1d
3
+ size 3526335990
data/train.lance/data/11101001110011100010100046d0854986bc99d0a347d8fb4b.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:267f7b526c82d29d0438fcd19dea9e58d2adb6a34a7c541e7a95d8b4b3c1720c
3
+ size 8605545977
data/val.lance/_indices/237b985c-d35e-4dd9-9085-d40b2fd89b7b/page_data.lance ADDED
Binary file (20.1 kB). View file
 
data/val.lance/_indices/237b985c-d35e-4dd9-9085-d40b2fd89b7b/page_lookup.lance ADDED
Binary file (1.26 kB). View file
 
data/val.lance/_indices/859bab32-5b3b-4f62-a571-4d92a3d23fcc/page_data.lance ADDED
Binary file (9.35 kB). View file
 
data/val.lance/_indices/859bab32-5b3b-4f62-a571-4d92a3d23fcc/page_lookup.lance ADDED
Binary file (1.26 kB). View file
 
data/val.lance/_indices/a0766726-3f80-47ad-a8a0-a4b131232b44/bitmap_page_lookup.lance ADDED
Binary file (33.6 kB). View file
 
data/val.lance/_indices/d9972903-52a6-41c5-b8f0-2431f1610dfc/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b52b2f000a57045a4f6023231860f33ddb52ca38248351b056a984f9625b3bd0
3
+ size 851396
data/val.lance/_indices/d9972903-52a6-41c5-b8f0-2431f1610dfc/index.idx ADDED
Binary file (33.1 kB). View file
 
data/val.lance/_transactions/0-c93ed2b4-aa42-4f04-b033-e4a4bb00b40a.txn ADDED
Binary file (711 Bytes). View file
 
data/val.lance/_transactions/1-f6de45e6-8488-44da-89e2-385245be4f24.txn ADDED
Binary file (189 Bytes). View file
 
data/val.lance/_transactions/2-f05b54f2-9aea-46b1-94ab-185f0393c6cf.txn ADDED
Binary file (196 Bytes). View file
 
data/val.lance/_transactions/3-5b39b9fd-8504-468e-86aa-e9b5373c0b69.txn ADDED
Binary file (198 Bytes). View file
 
data/val.lance/_transactions/4-9d5a908c-fd15-4915-b54e-94a05e212f97.txn ADDED
Binary file (195 Bytes). View file
 
data/val.lance/_versions/18446744073709551610.manifest ADDED
Binary file (1.6 kB). View file
 
data/val.lance/_versions/18446744073709551611.manifest ADDED
Binary file (1.45 kB). View file
 
data/val.lance/_versions/18446744073709551612.manifest ADDED
Binary file (1.3 kB). View file
 
data/val.lance/_versions/18446744073709551613.manifest ADDED
Binary file (1.14 kB). View file
 
data/val.lance/_versions/18446744073709551614.manifest ADDED
Binary file (1.51 kB). View file
 
data/val.lance/data/0100001111001100000000000fef594f858dfb7f7a035a8f02.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbb84ffd16dd73aba29bec9ddf2f6d581da7814f14e0ee4c5904ff5f89bab762
3
+ size 510040851