visionpack 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. visionpack-0.0.1/LICENSE +202 -0
  2. visionpack-0.0.1/PKG-INFO +248 -0
  3. visionpack-0.0.1/README.md +215 -0
  4. visionpack-0.0.1/pyproject.toml +72 -0
  5. visionpack-0.0.1/setup.cfg +4 -0
  6. visionpack-0.0.1/tests/test_coco_flow.py +85 -0
  7. visionpack-0.0.1/tests/test_duplicates.py +100 -0
  8. visionpack-0.0.1/tests/test_fsck.py +70 -0
  9. visionpack-0.0.1/tests/test_import_record.py +113 -0
  10. visionpack-0.0.1/tests/test_index.py +144 -0
  11. visionpack-0.0.1/tests/test_lock.py +33 -0
  12. visionpack-0.0.1/tests/test_manifest.py +43 -0
  13. visionpack-0.0.1/tests/test_media.py +49 -0
  14. visionpack-0.0.1/tests/test_multisource.py +63 -0
  15. visionpack-0.0.1/tests/test_pack_training.py +135 -0
  16. visionpack-0.0.1/tests/test_project.py +54 -0
  17. visionpack-0.0.1/tests/test_resilience.py +60 -0
  18. visionpack-0.0.1/tests/test_snapshot_dedup.py +62 -0
  19. visionpack-0.0.1/tests/test_snapshot_restore.py +71 -0
  20. visionpack-0.0.1/tests/test_sources.py +164 -0
  21. visionpack-0.0.1/tests/test_split.py +150 -0
  22. visionpack-0.0.1/tests/test_tasks.py +147 -0
  23. visionpack-0.0.1/tests/test_yolo_flow.py +100 -0
  24. visionpack-0.0.1/visionpack/__init__.py +5 -0
  25. visionpack-0.0.1/visionpack/__main__.py +4 -0
  26. visionpack-0.0.1/visionpack/cli/__init__.py +1 -0
  27. visionpack-0.0.1/visionpack/cli/commands/__init__.py +1 -0
  28. visionpack-0.0.1/visionpack/cli/commands/annotate.py +25 -0
  29. visionpack-0.0.1/visionpack/cli/commands/diff.py +36 -0
  30. visionpack-0.0.1/visionpack/cli/commands/export.py +56 -0
  31. visionpack-0.0.1/visionpack/cli/commands/fsck.py +38 -0
  32. visionpack-0.0.1/visionpack/cli/commands/import_.py +144 -0
  33. visionpack-0.0.1/visionpack/cli/commands/init.py +25 -0
  34. visionpack-0.0.1/visionpack/cli/commands/pack.py +56 -0
  35. visionpack-0.0.1/visionpack/cli/commands/snapshot.py +50 -0
  36. visionpack-0.0.1/visionpack/cli/commands/split.py +90 -0
  37. visionpack-0.0.1/visionpack/cli/commands/stats.py +46 -0
  38. visionpack-0.0.1/visionpack/cli/commands/sync.py +71 -0
  39. visionpack-0.0.1/visionpack/cli/commands/validate.py +33 -0
  40. visionpack-0.0.1/visionpack/cli/main.py +44 -0
  41. visionpack-0.0.1/visionpack/core/__init__.py +3 -0
  42. visionpack-0.0.1/visionpack/core/errors.py +14 -0
  43. visionpack-0.0.1/visionpack/core/lock.py +66 -0
  44. visionpack-0.0.1/visionpack/core/manifest.py +360 -0
  45. visionpack-0.0.1/visionpack/core/models.py +275 -0
  46. visionpack-0.0.1/visionpack/core/project.py +100 -0
  47. visionpack-0.0.1/visionpack/diff.py +40 -0
  48. visionpack-0.0.1/visionpack/duplicates.py +145 -0
  49. visionpack-0.0.1/visionpack/formats/__init__.py +12 -0
  50. visionpack-0.0.1/visionpack/formats/base.py +25 -0
  51. visionpack-0.0.1/visionpack/formats/classification.py +177 -0
  52. visionpack-0.0.1/visionpack/formats/coco.py +303 -0
  53. visionpack-0.0.1/visionpack/formats/yolo.py +327 -0
  54. visionpack-0.0.1/visionpack/fsck.py +107 -0
  55. visionpack-0.0.1/visionpack/index/__init__.py +7 -0
  56. visionpack-0.0.1/visionpack/index/json_index.py +97 -0
  57. visionpack-0.0.1/visionpack/index/sqlite_index.py +298 -0
  58. visionpack-0.0.1/visionpack/media.py +64 -0
  59. visionpack-0.0.1/visionpack/packing/__init__.py +4 -0
  60. visionpack-0.0.1/visionpack/packing/archive.py +163 -0
  61. visionpack-0.0.1/visionpack/packing/webdataset.py +192 -0
  62. visionpack-0.0.1/visionpack/perceptual.py +67 -0
  63. visionpack-0.0.1/visionpack/progress.py +50 -0
  64. visionpack-0.0.1/visionpack/py.typed +0 -0
  65. visionpack-0.0.1/visionpack/snapshot.py +181 -0
  66. visionpack-0.0.1/visionpack/sources/__init__.py +18 -0
  67. visionpack-0.0.1/visionpack/sources/importer.py +501 -0
  68. visionpack-0.0.1/visionpack/sources/join.py +50 -0
  69. visionpack-0.0.1/visionpack/sources/resolver.py +125 -0
  70. visionpack-0.0.1/visionpack/sources/schema.py +76 -0
  71. visionpack-0.0.1/visionpack/split.py +183 -0
  72. visionpack-0.0.1/visionpack/stats.py +80 -0
  73. visionpack-0.0.1/visionpack/storage/__init__.py +4 -0
  74. visionpack-0.0.1/visionpack/storage/hash.py +23 -0
  75. visionpack-0.0.1/visionpack/storage/object_store.py +49 -0
  76. visionpack-0.0.1/visionpack/validation/__init__.py +3 -0
  77. visionpack-0.0.1/visionpack/validation/engine.py +222 -0
  78. visionpack-0.0.1/visionpack.egg-info/PKG-INFO +248 -0
  79. visionpack-0.0.1/visionpack.egg-info/SOURCES.txt +81 -0
  80. visionpack-0.0.1/visionpack.egg-info/dependency_links.txt +1 -0
  81. visionpack-0.0.1/visionpack.egg-info/entry_points.txt +3 -0
  82. visionpack-0.0.1/visionpack.egg-info/requires.txt +6 -0
  83. visionpack-0.0.1/visionpack.egg-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.4
2
+ Name: visionpack
3
+ Version: 0.0.1
4
+ Summary: DatasetOps for computer vision datasets
5
+ Author-email: Caio Wingeter <caio@airis-tech.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/CaioWing/VisionPack
8
+ Project-URL: Repository, https://github.com/CaioWing/VisionPack
9
+ Project-URL: Issues, https://github.com/CaioWing/VisionPack/issues
10
+ Keywords: computer-vision,dataset,datasetops,yolo,coco,mlops,machine-learning,annotations,reproducibility,deduplication
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: orjson>=3.11.9
27
+ Requires-Dist: pillow>=12.2.0
28
+ Requires-Dist: pydantic>=2.13.4
29
+ Requires-Dist: pyyaml>=6.0.3
30
+ Requires-Dist: rich>=15.0.0
31
+ Requires-Dist: zstandard>=0.25.0
32
+ Dynamic: license-file
33
+
34
+ # VisionPack
35
+
36
+ **DatasetOps for Computer Vision** — a Git/Docker-like CLI for the messy part of
37
+ training models: turning scattered images and labels into a clean, versioned,
38
+ leak-free, ready-to-train dataset.
39
+
40
+ [![CI](https://github.com/CaioWing/VisionPack/actions/workflows/ci.yml/badge.svg)](https://github.com/CaioWing/VisionPack/actions/workflows/ci.yml)
41
+ ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
42
+ ![License](https://img.shields.io/badge/license-Apache--2.0-blue)
43
+ ![Status](https://img.shields.io/badge/status-active%20development-orange)
44
+ ![Tests](https://img.shields.io/badge/tests-79%20passing-brightgreen)
45
+
46
+ ```bash
47
+ vp init --name factory-defects --task detection
48
+ vp sync # pull images + labels from the sources in visionpack.yaml
49
+ vp validate # catch corrupt images, bad boxes, near-duplicate leakage
50
+ vp split create # deterministic, reproducible train/val/test
51
+ vp snapshot create -m "baseline"
52
+ vp export --format yolo --split # ready-to-train layout
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Why VisionPack
58
+
59
+ Most of the pain in a CV project isn't the model — it's the dataset. VisionPack
60
+ targets the failures that quietly cost you accuracy and reproducibility:
61
+
62
+ - **Train/test leakage that inflates your metrics.** Exact-duplicate detection is
63
+ not enough: a re-encoded or resized copy of a training image landing in the test
64
+ set makes your reported numbers a lie. VisionPack catches **near-duplicate**
65
+ leakage with perceptual hashing.
66
+ - **Splits you can't reproduce.** "I shuffled with `random.seed(42)`" breaks the
67
+ moment data is added or reordered. VisionPack splits are a function of image
68
+ *content*, so they're identical across machines and stable as the dataset grows.
69
+ - **Data scattered across places.** Images in one bucket, labels in another repo,
70
+ classes in a third. Declare them once and `vp sync` assembles the dataset.
71
+ - **"Which dataset trained this model?"** Content-addressed snapshots make that
72
+ answerable instead of a guess.
73
+
74
+ It's built to **complement, not replace** CVAT, FiftyOne, DVC, Roboflow, and Label
75
+ Studio — VisionPack is the DatasetOps layer that imports, validates, versions,
76
+ splits, packs, and exports.
77
+
78
+ ---
79
+
80
+ ## Install
81
+
82
+ VisionPack uses [`uv`](https://github.com/astral-sh/uv). From the repo root:
83
+
84
+ ```bash
85
+ uv sync
86
+ uv run vp --help
87
+ ```
88
+
89
+ Requires Python 3.11+.
90
+
91
+ ---
92
+
93
+ ## Quickstart (60 seconds)
94
+
95
+ ```bash
96
+ # 1. create a project (the manifest is visionpack.yaml)
97
+ uv run vp init --name factory-defects --task detection
98
+
99
+ # 2. bring in a YOLO dataset
100
+ uv run vp import ./raw --format yolo
101
+
102
+ # 3. check it for real problems
103
+ uv run vp validate
104
+
105
+ # 4. a deterministic, reproducible split
106
+ uv run vp split create --train 0.8 --val 0.1 --test 0.1 --strategy stratified
107
+ uv run vp split lock
108
+
109
+ # 5. freeze a reproducible version
110
+ uv run vp snapshot create -m "initial import"
111
+
112
+ # 6. comparable metrics as the dataset grows
113
+ uv run vp stats --by split
114
+
115
+ # 7. a ready-to-train layout
116
+ uv run vp export --format yolo --split
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Works across the common CV tasks
122
+
123
+ VisionPack's annotation model carries a tagged geometry, so one tool covers the
124
+ tasks you actually use:
125
+
126
+ | Task | Import | Geometry |
127
+ |------|--------|----------|
128
+ | **Classification** | ImageFolder (folder-per-class) | whole-image label |
129
+ | **Detection** | YOLO, COCO | bounding box |
130
+ | **Instance segmentation** | COCO | polygon |
131
+ | **Keypoints / pose** | COCO | keypoints |
132
+
133
+ ```bash
134
+ # classification from a folder-per-class layout
135
+ uv run vp init --name product-grades --task classification
136
+ uv run vp import ./train --format imagefolder
137
+ uv run vp export --format imagefolder --split # train/val/test/<class>/…
138
+
139
+ # detection or instance segmentation from COCO
140
+ uv run vp init --name cells --task segmentation
141
+ uv run vp import ./instances.json --format coco --images ./images
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Assemble a dataset from many sources
147
+
148
+ Images and labels rarely live together. Declare them in `visionpack.yaml`:
149
+
150
+ ```yaml
151
+ sources:
152
+ - name: camera-A
153
+ format: yolo
154
+ images: ./repoA/images # images here…
155
+ labels: ./repoB # …labels in another repo
156
+ classes: ./repoB/classes.txt
157
+ match: stem # pair by filename (or `relpath` for parallel trees)
158
+ copy: ingest
159
+ ```
160
+
161
+ Then reconcile the dataset — idempotently, so re-running only pulls what's new:
162
+
163
+ ```bash
164
+ uv run vp sync --dry-run # preview: found / matched / unmatched / classes
165
+ uv run vp sync # ingest; classes merge by name, provenance recorded
166
+ ```
167
+
168
+ Classes from different sources merge **by name** (YOLO indices are mapped through
169
+ each source's own class order, never positionally), so reordered class lists don't
170
+ mislabel your data.
171
+
172
+ A one-off `vp import` also records what it imported as a source in
173
+ `visionpack.yaml`, so the manifest stays the single source of truth and the data
174
+ can be re-pulled later with `vp sync` (use `--no-record` for a throwaway import).
175
+
176
+ ---
177
+
178
+ ## What's in the box
179
+
180
+ - **Deterministic, lockable splits** — `stratified` / `random` / `hash`
181
+ (growth-stable), captured in snapshots.
182
+ - **Near-duplicate & cross-split leakage detection** — perceptual-hash tier, no
183
+ extra dependencies, scale-proof via LSH bucketing; surfaced in `vp validate`.
184
+ - **Multi-source sync** — declarative `sources:` + `vp sync`, with per-asset
185
+ provenance and a resolver layer ready for remote backends.
186
+ - **Content-addressed snapshots & diff** — reproducible versions; compare any two.
187
+ - **Strong validation** — unreadable images, missing/orphan labels, unknown
188
+ classes, invalid/out-of-bounds boxes, exact + near duplicates, split leakage.
189
+ - **Comparable metrics** — per-split stats so class balance stays auditable as data
190
+ grows.
191
+ - **Packing** — `archive` (`.tar.zst`, self-contained) and `training`
192
+ (split-aware WebDataset shards).
193
+ - **Interoperable I/O** — YOLO, COCO, ImageFolder in and out.
194
+
195
+ Full command reference and per-command options live in the
196
+ [usage guide](docs/usage.md).
197
+
198
+ ---
199
+
200
+ ## Release process
201
+
202
+ Releases are prepared locally, reviewed as a GitHub Release draft, and published
203
+ to PyPI only when the GitHub Release is published.
204
+
205
+ ```powershell
206
+ .\scripts\prepare-release.ps1 0.1.1
207
+ git push origin HEAD
208
+ git push origin v0.1.1
209
+ gh release create v0.1.1 --draft --title "v0.1.1" --notes-file CHANGELOG.md
210
+ ```
211
+
212
+ Review the draft release notes in GitHub. Publishing the release triggers
213
+ `.github/workflows/publish.yml`, which builds the package, validates the
214
+ artifacts with `twine check`, and publishes to PyPI through Trusted Publishing.
215
+
216
+ Use `-NoCommit -NoTag` to update files and run the checks without creating the
217
+ release commit or tag:
218
+
219
+ ```powershell
220
+ .\scripts\prepare-release.ps1 0.1.1 -NoCommit -NoTag
221
+ ```
222
+
223
+ ---
224
+
225
+ ## How it works
226
+
227
+ VisionPack is **manifest-driven** and **content-addressed**: `visionpack.yaml`
228
+ declares the dataset, raw images are stored once by `sha256` (immutable), and
229
+ annotations / splits / snapshots are the versioned layer on top. The truth is the
230
+ manifest + index, never "a folder with the right name".
231
+
232
+ For the design principles, module map, data model, subsystems, and the full
233
+ roadmap, see **[ARCHITECTURE.md](ARCHITECTURE.md)**. For the original product
234
+ vision, see **[docs/DESIGN.md](docs/DESIGN.md)**.
235
+
236
+ ---
237
+
238
+ ## Status
239
+
240
+ VisionPack is in **active development** (early but usable). The core workflow —
241
+ multi-source ingestion → validation → deterministic splits → snapshots →
242
+ ready-to-train export/packing — works end-to-end across classification, detection,
243
+ instance segmentation, and keypoints, with 55 passing tests. APIs may still shift;
244
+ feedback and contributions are welcome.
245
+
246
+ ```bash
247
+ uv run python -m unittest discover -s tests -q
248
+ ```
@@ -0,0 +1,215 @@
1
+ # VisionPack
2
+
3
+ **DatasetOps for Computer Vision** — a Git/Docker-like CLI for the messy part of
4
+ training models: turning scattered images and labels into a clean, versioned,
5
+ leak-free, ready-to-train dataset.
6
+
7
+ [![CI](https://github.com/CaioWing/VisionPack/actions/workflows/ci.yml/badge.svg)](https://github.com/CaioWing/VisionPack/actions/workflows/ci.yml)
8
+ ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
9
+ ![License](https://img.shields.io/badge/license-Apache--2.0-blue)
10
+ ![Status](https://img.shields.io/badge/status-active%20development-orange)
11
+ ![Tests](https://img.shields.io/badge/tests-79%20passing-brightgreen)
12
+
13
+ ```bash
14
+ vp init --name factory-defects --task detection
15
+ vp sync # pull images + labels from the sources in visionpack.yaml
16
+ vp validate # catch corrupt images, bad boxes, near-duplicate leakage
17
+ vp split create # deterministic, reproducible train/val/test
18
+ vp snapshot create -m "baseline"
19
+ vp export --format yolo --split # ready-to-train layout
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Why VisionPack
25
+
26
+ Most of the pain in a CV project isn't the model — it's the dataset. VisionPack
27
+ targets the failures that quietly cost you accuracy and reproducibility:
28
+
29
+ - **Train/test leakage that inflates your metrics.** Exact-duplicate detection is
30
+ not enough: a re-encoded or resized copy of a training image landing in the test
31
+ set makes your reported numbers a lie. VisionPack catches **near-duplicate**
32
+ leakage with perceptual hashing.
33
+ - **Splits you can't reproduce.** "I shuffled with `random.seed(42)`" breaks the
34
+ moment data is added or reordered. VisionPack splits are a function of image
35
+ *content*, so they're identical across machines and stable as the dataset grows.
36
+ - **Data scattered across places.** Images in one bucket, labels in another repo,
37
+ classes in a third. Declare them once and `vp sync` assembles the dataset.
38
+ - **"Which dataset trained this model?"** Content-addressed snapshots make that
39
+ answerable instead of a guess.
40
+
41
+ It's built to **complement, not replace** CVAT, FiftyOne, DVC, Roboflow, and Label
42
+ Studio — VisionPack is the DatasetOps layer that imports, validates, versions,
43
+ splits, packs, and exports.
44
+
45
+ ---
46
+
47
+ ## Install
48
+
49
+ VisionPack uses [`uv`](https://github.com/astral-sh/uv). From the repo root:
50
+
51
+ ```bash
52
+ uv sync
53
+ uv run vp --help
54
+ ```
55
+
56
+ Requires Python 3.11+.
57
+
58
+ ---
59
+
60
+ ## Quickstart (60 seconds)
61
+
62
+ ```bash
63
+ # 1. create a project (the manifest is visionpack.yaml)
64
+ uv run vp init --name factory-defects --task detection
65
+
66
+ # 2. bring in a YOLO dataset
67
+ uv run vp import ./raw --format yolo
68
+
69
+ # 3. check it for real problems
70
+ uv run vp validate
71
+
72
+ # 4. a deterministic, reproducible split
73
+ uv run vp split create --train 0.8 --val 0.1 --test 0.1 --strategy stratified
74
+ uv run vp split lock
75
+
76
+ # 5. freeze a reproducible version
77
+ uv run vp snapshot create -m "initial import"
78
+
79
+ # 6. comparable metrics as the dataset grows
80
+ uv run vp stats --by split
81
+
82
+ # 7. a ready-to-train layout
83
+ uv run vp export --format yolo --split
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Works across the common CV tasks
89
+
90
+ VisionPack's annotation model carries a tagged geometry, so one tool covers the
91
+ tasks you actually use:
92
+
93
+ | Task | Import | Geometry |
94
+ |------|--------|----------|
95
+ | **Classification** | ImageFolder (folder-per-class) | whole-image label |
96
+ | **Detection** | YOLO, COCO | bounding box |
97
+ | **Instance segmentation** | COCO | polygon |
98
+ | **Keypoints / pose** | COCO | keypoints |
99
+
100
+ ```bash
101
+ # classification from a folder-per-class layout
102
+ uv run vp init --name product-grades --task classification
103
+ uv run vp import ./train --format imagefolder
104
+ uv run vp export --format imagefolder --split # train/val/test/<class>/…
105
+
106
+ # detection or instance segmentation from COCO
107
+ uv run vp init --name cells --task segmentation
108
+ uv run vp import ./instances.json --format coco --images ./images
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Assemble a dataset from many sources
114
+
115
+ Images and labels rarely live together. Declare them in `visionpack.yaml`:
116
+
117
+ ```yaml
118
+ sources:
119
+ - name: camera-A
120
+ format: yolo
121
+ images: ./repoA/images # images here…
122
+ labels: ./repoB # …labels in another repo
123
+ classes: ./repoB/classes.txt
124
+ match: stem # pair by filename (or `relpath` for parallel trees)
125
+ copy: ingest
126
+ ```
127
+
128
+ Then reconcile the dataset — idempotently, so re-running only pulls what's new:
129
+
130
+ ```bash
131
+ uv run vp sync --dry-run # preview: found / matched / unmatched / classes
132
+ uv run vp sync # ingest; classes merge by name, provenance recorded
133
+ ```
134
+
135
+ Classes from different sources merge **by name** (YOLO indices are mapped through
136
+ each source's own class order, never positionally), so reordered class lists don't
137
+ mislabel your data.
138
+
139
+ A one-off `vp import` also records what it imported as a source in
140
+ `visionpack.yaml`, so the manifest stays the single source of truth and the data
141
+ can be re-pulled later with `vp sync` (use `--no-record` for a throwaway import).
142
+
143
+ ---
144
+
145
+ ## What's in the box
146
+
147
+ - **Deterministic, lockable splits** — `stratified` / `random` / `hash`
148
+ (growth-stable), captured in snapshots.
149
+ - **Near-duplicate & cross-split leakage detection** — perceptual-hash tier, no
150
+ extra dependencies, scale-proof via LSH bucketing; surfaced in `vp validate`.
151
+ - **Multi-source sync** — declarative `sources:` + `vp sync`, with per-asset
152
+ provenance and a resolver layer ready for remote backends.
153
+ - **Content-addressed snapshots & diff** — reproducible versions; compare any two.
154
+ - **Strong validation** — unreadable images, missing/orphan labels, unknown
155
+ classes, invalid/out-of-bounds boxes, exact + near duplicates, split leakage.
156
+ - **Comparable metrics** — per-split stats so class balance stays auditable as data
157
+ grows.
158
+ - **Packing** — `archive` (`.tar.zst`, self-contained) and `training`
159
+ (split-aware WebDataset shards).
160
+ - **Interoperable I/O** — YOLO, COCO, ImageFolder in and out.
161
+
162
+ Full command reference and per-command options live in the
163
+ [usage guide](docs/usage.md).
164
+
165
+ ---
166
+
167
+ ## Release process
168
+
169
+ Releases are prepared locally, reviewed as a GitHub Release draft, and published
170
+ to PyPI only when the GitHub Release is published.
171
+
172
+ ```powershell
173
+ .\scripts\prepare-release.ps1 0.1.1
174
+ git push origin HEAD
175
+ git push origin v0.1.1
176
+ gh release create v0.1.1 --draft --title "v0.1.1" --notes-file CHANGELOG.md
177
+ ```
178
+
179
+ Review the draft release notes in GitHub. Publishing the release triggers
180
+ `.github/workflows/publish.yml`, which builds the package, validates the
181
+ artifacts with `twine check`, and publishes to PyPI through Trusted Publishing.
182
+
183
+ Use `-NoCommit -NoTag` to update files and run the checks without creating the
184
+ release commit or tag:
185
+
186
+ ```powershell
187
+ .\scripts\prepare-release.ps1 0.1.1 -NoCommit -NoTag
188
+ ```
189
+
190
+ ---
191
+
192
+ ## How it works
193
+
194
+ VisionPack is **manifest-driven** and **content-addressed**: `visionpack.yaml`
195
+ declares the dataset, raw images are stored once by `sha256` (immutable), and
196
+ annotations / splits / snapshots are the versioned layer on top. The truth is the
197
+ manifest + index, never "a folder with the right name".
198
+
199
+ For the design principles, module map, data model, subsystems, and the full
200
+ roadmap, see **[ARCHITECTURE.md](ARCHITECTURE.md)**. For the original product
201
+ vision, see **[docs/DESIGN.md](docs/DESIGN.md)**.
202
+
203
+ ---
204
+
205
+ ## Status
206
+
207
+ VisionPack is in **active development** (early but usable). The core workflow —
208
+ multi-source ingestion → validation → deterministic splits → snapshots →
209
+ ready-to-train export/packing — works end-to-end across classification, detection,
210
+ instance segmentation, and keypoints, with 55 passing tests. APIs may still shift;
211
+ feedback and contributions are welcome.
212
+
213
+ ```bash
214
+ uv run python -m unittest discover -s tests -q
215
+ ```