ayushexel commited on
Commit
b2737ec
·
verified ·
1 Parent(s): 3b5d30f

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -58,3 +58,7 @@ 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/validation.lance/_indices/bd3edff1-bb48-43d0-a648-377d884233ef/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
62
+ data/train.lance/_indices/d8f949af-09c1-45ff-b493-c08b90156dda/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
63
+ data/train.lance/data/1011101110110101101001108ff8184efa86ae859ef5f49b24.lance filter=lfs diff=lfs merge=lfs -text
64
+ data/validation.lance/data/111000111111001110101101ac6d274279b48735d4e849ae11.lance filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ task_categories:
4
+ - image-segmentation
5
+ - image-feature-extraction
6
+ language:
7
+ - en
8
+ tags:
9
+ - pascal-voc
10
+ - voc-2012
11
+ - semantic-segmentation
12
+ - lance
13
+ - clip-embeddings
14
+ pretty_name: pascal-voc-2012-segmentation-lance
15
+ size_categories:
16
+ - 1K<n<10K
17
+ ---
18
+ # Pascal VOC 2012 Segmentation (Lance Format)
19
+
20
+ A Lance-formatted version of the [Pascal VOC 2012 semantic segmentation split](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/) (sourced from [`nateraw/pascal-voc-2012`](https://huggingface.co/datasets/nateraw/pascal-voc-2012)) — **2,913 image / mask pairs** with CLIP image embeddings stored inline and a pre-built `IVF_PQ` ANN index.
21
+
22
+ ## Why segmentation?
23
+
24
+ VOC 2012 ships several tasks (classification, detection, segmentation, action). We focus on the **semantic segmentation** subset because every row carries a paired mask image and the dataset is small enough to convert quickly with full embeddings — useful as a smoke test or a small benchmark.
25
+
26
+ ## Splits
27
+
28
+ | Split | Rows |
29
+ |-------|------|
30
+ | `train.lance` | 1,464 |
31
+ | `validation.lance` | 1,449 |
32
+
33
+ ## Schema
34
+
35
+ | Column | Type | Notes |
36
+ |---|---|---|
37
+ | `id` | `int64` | Row index within the split |
38
+ | `image` | `large_binary` | Inline JPEG bytes |
39
+ | `mask` | `large_binary` | Inline PNG bytes — class id per pixel (0=background, 1-20=VOC classes, 255=void) |
40
+ | `image_emb` | `fixed_size_list<float32, 512>` | OpenCLIP `ViT-B-32` image embedding (cosine-normalized) |
41
+
42
+ The 20 Pascal VOC classes are: `aeroplane`, `bicycle`, `bird`, `boat`, `bottle`, `bus`, `car`, `cat`, `chair`, `cow`, `diningtable`, `dog`, `horse`, `motorbike`, `person`, `pottedplant`, `sheep`, `sofa`, `train`, `tvmonitor`.
43
+
44
+ ## Pre-built indices
45
+
46
+ - `IVF_PQ` on `image_emb` — `metric=cosine`
47
+
48
+ > Note: the small dataset size (≤1,464 rows per split) is below Lance's
49
+ > default partition count, so the helper falls back to a smaller
50
+ > `num_partitions` automatically. For higher recall, build the index with
51
+ > `num_partitions=16` against a local copy.
52
+
53
+ ## Quick start
54
+
55
+ ```python
56
+ import lance
57
+
58
+ ds = lance.dataset("hf://datasets/lance-format/pascal-voc-2012-segmentation-lance/data/train.lance")
59
+ print(ds.count_rows(), ds.schema.names, ds.list_indices())
60
+ ```
61
+
62
+ ## Working with images and masks
63
+
64
+ ```python
65
+ from pathlib import Path
66
+ import lance
67
+ from PIL import Image
68
+ import io
69
+
70
+ ds = lance.dataset("hf://datasets/lance-format/pascal-voc-2012-segmentation-lance/data/train.lance")
71
+ row = ds.take([0], columns=["image", "mask"]).to_pylist()[0]
72
+ Path("img.jpg").write_bytes(row["image"])
73
+ Path("mask.png").write_bytes(row["mask"])
74
+
75
+ import numpy as np
76
+ mask = np.array(Image.open(io.BytesIO(row["mask"])))
77
+ print("classes present:", np.unique(mask).tolist())
78
+ ```
79
+
80
+ ## Vector search example
81
+
82
+ ```python
83
+ import lance
84
+ import pyarrow as pa
85
+
86
+ ds = lance.dataset("hf://datasets/lance-format/pascal-voc-2012-segmentation-lance/data/train.lance")
87
+ emb_field = ds.schema.field("image_emb")
88
+ ref = ds.take([0], columns=["image_emb"]).to_pylist()[0]["image_emb"]
89
+ query = pa.array([ref], type=emb_field.type)
90
+
91
+ neighbors = ds.scanner(
92
+ nearest={"column": "image_emb", "q": query[0], "k": 5},
93
+ columns=["id"],
94
+ ).to_table().to_pylist()
95
+ ```
96
+
97
+ ## Why Lance?
98
+
99
+ - One dataset carries images + masks + embeddings + indices — no sidecar files.
100
+ - On-disk vector and full-text indices live next to the data, so search works on local copies and on the Hub.
101
+ - Schema evolution: add columns (instance masks, alternate embeddings, model predictions) without rewriting the data.
102
+
103
+ ## Source & license
104
+
105
+ Converted from [`nateraw/pascal-voc-2012`](https://huggingface.co/datasets/nateraw/pascal-voc-2012). The Pascal VOC dataset is released under [its own custom license](http://host.robots.ox.ac.uk/pascal/VOC/) — please review before redistribution.
106
+
107
+ ## Citation
108
+
109
+ ```
110
+ @misc{everingham2012pascal,
111
+ title={The Pascal Visual Object Classes Challenge: A Retrospective},
112
+ author={Everingham, Mark and Eslami, S. M. Ali and Van Gool, Luc and Williams, Christopher K. I. and Winn, John and Zisserman, Andrew},
113
+ journal={International Journal of Computer Vision},
114
+ year={2015}
115
+ }
116
+ ```
data/train.lance/_indices/d8f949af-09c1-45ff-b493-c08b90156dda/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2db5e33ae3ed181b29b47a03688d7330e54d608d190e8632544b937ef6804c4a
3
+ size 621955
data/train.lance/_indices/d8f949af-09c1-45ff-b493-c08b90156dda/index.idx ADDED
Binary file (33.1 kB). View file
 
data/train.lance/_transactions/0-29b5768a-8946-4b1f-a827-957c99c0365e.txn ADDED
Binary file (284 Bytes). View file
 
data/train.lance/_transactions/1-303f4d06-5224-49b6-841c-33af75f06645.txn ADDED
Binary file (189 Bytes). View file
 
data/train.lance/_versions/18446744073709551613.manifest ADDED
Binary file (710 Bytes). View file
 
data/train.lance/_versions/18446744073709551614.manifest ADDED
Binary file (653 Bytes). View file
 
data/train.lance/data/1011101110110101101001108ff8184efa86ae859ef5f49b24.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16b32bdc9a2bf9a1c72fd09eb95658c11474e15bb8bef3dab804f10da020f40f
3
+ size 60056128
data/validation.lance/_indices/bd3edff1-bb48-43d0-a648-377d884233ef/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e5a4bad7a6faacc66839fa4e5128f117100fd5f518607d150e7c27d2fbc374b
3
+ size 620995
data/validation.lance/_indices/bd3edff1-bb48-43d0-a648-377d884233ef/index.idx ADDED
Binary file (33.1 kB). View file
 
data/validation.lance/_transactions/0-028d484e-5fdd-4957-9aeb-36f88603b667.txn ADDED
Binary file (284 Bytes). View file
 
data/validation.lance/_transactions/1-adfad3bb-5b1f-4fda-99f4-e450ba6f8840.txn ADDED
Binary file (189 Bytes). View file
 
data/validation.lance/_versions/18446744073709551613.manifest ADDED
Binary file (709 Bytes). View file
 
data/validation.lance/_versions/18446744073709551614.manifest ADDED
Binary file (653 Bytes). View file
 
data/validation.lance/data/111000111111001110101101ac6d274279b48735d4e849ae11.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a0ea4e87e0b1851cd2e73a7cae7e98b296237eb73648d49364146cdb37445d3
3
+ size 60319296