amv-vision 2.0.0__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 (94) hide show
  1. amv_vision-2.0.0/LICENSE +176 -0
  2. amv_vision-2.0.0/MANIFEST.in +4 -0
  3. amv_vision-2.0.0/NOTICE +17 -0
  4. amv_vision-2.0.0/PKG-INFO +359 -0
  5. amv_vision-2.0.0/README.md +317 -0
  6. amv_vision-2.0.0/amv_vision/__init__.py +75 -0
  7. amv_vision-2.0.0/amv_vision/__main__.py +7 -0
  8. amv_vision-2.0.0/amv_vision/adapter.py +201 -0
  9. amv_vision-2.0.0/amv_vision/bridge/__init__.py +13 -0
  10. amv_vision-2.0.0/amv_vision/bridge/amv_train_bridge.py +87 -0
  11. amv_vision-2.0.0/amv_vision/cli/__init__.py +5 -0
  12. amv_vision-2.0.0/amv_vision/cli/doctor.py +122 -0
  13. amv_vision-2.0.0/amv_vision/cli/main.py +548 -0
  14. amv_vision-2.0.0/amv_vision/cluster.py +219 -0
  15. amv_vision-2.0.0/amv_vision/control/__init__.py +5 -0
  16. amv_vision-2.0.0/amv_vision/control/component.py +391 -0
  17. amv_vision-2.0.0/amv_vision/control/status.py +15 -0
  18. amv_vision-2.0.0/amv_vision/csrc/__init__.py +24 -0
  19. amv_vision-2.0.0/amv_vision/csrc/backend.py +488 -0
  20. amv_vision-2.0.0/amv_vision/cv/__init__.py +24 -0
  21. amv_vision-2.0.0/amv_vision/cv/contours.py +79 -0
  22. amv_vision-2.0.0/amv_vision/cv/crop.py +24 -0
  23. amv_vision-2.0.0/amv_vision/cv/filters.py +165 -0
  24. amv_vision-2.0.0/amv_vision/cv/integral.py +62 -0
  25. amv_vision-2.0.0/amv_vision/cv/morphology.py +76 -0
  26. amv_vision-2.0.0/amv_vision/detect/__init__.py +16 -0
  27. amv_vision-2.0.0/amv_vision/detect/haar.py +194 -0
  28. amv_vision-2.0.0/amv_vision/detect/neural.py +129 -0
  29. amv_vision-2.0.0/amv_vision/detect/nms.py +85 -0
  30. amv_vision-2.0.0/amv_vision/detect/types.py +51 -0
  31. amv_vision-2.0.0/amv_vision/downloader.py +38 -0
  32. amv_vision-2.0.0/amv_vision/errors.py +306 -0
  33. amv_vision-2.0.0/amv_vision/exceptions.py +273 -0
  34. amv_vision-2.0.0/amv_vision/hardware.py +295 -0
  35. amv_vision-2.0.0/amv_vision/installer.py +573 -0
  36. amv_vision-2.0.0/amv_vision/io/__init__.py +14 -0
  37. amv_vision-2.0.0/amv_vision/io/camera.py +39 -0
  38. amv_vision-2.0.0/amv_vision/io/limits.py +35 -0
  39. amv_vision-2.0.0/amv_vision/io/loader.py +116 -0
  40. amv_vision-2.0.0/amv_vision/io/safetensors.py +99 -0
  41. amv_vision-2.0.0/amv_vision/models/__init__.py +17 -0
  42. amv_vision-2.0.0/amv_vision/models/conv_block.py +89 -0
  43. amv_vision-2.0.0/amv_vision/models/embedding.py +44 -0
  44. amv_vision-2.0.0/amv_vision/models/mobilenet.py +78 -0
  45. amv_vision-2.0.0/amv_vision/models/vit_patch.py +62 -0
  46. amv_vision-2.0.0/amv_vision/models/yolo_detector.py +89 -0
  47. amv_vision-2.0.0/amv_vision/models/yolo_post.py +83 -0
  48. amv_vision-2.0.0/amv_vision/transforms/__init__.py +46 -0
  49. amv_vision-2.0.0/amv_vision/transforms/compose.py +59 -0
  50. amv_vision-2.0.0/amv_vision/transforms/functional.py +115 -0
  51. amv_vision-2.0.0/amv_vision/transforms/scale.py +101 -0
  52. amv_vision-2.0.0/amv_vision/vlm/__init__.py +38 -0
  53. amv_vision-2.0.0/amv_vision/vlm/adapters/__init__.py +19 -0
  54. amv_vision-2.0.0/amv_vision/vlm/adapters/base.py +19 -0
  55. amv_vision-2.0.0/amv_vision/vlm/adapters/qwen2vl.py +10 -0
  56. amv_vision-2.0.0/amv_vision/vlm/adapters/smolvlm.py +10 -0
  57. amv_vision-2.0.0/amv_vision/vlm/api.py +290 -0
  58. amv_vision-2.0.0/amv_vision/vlm/cache.py +553 -0
  59. amv_vision-2.0.0/amv_vision/vlm/engine.py +243 -0
  60. amv_vision-2.0.0/amv_vision/vlm/manifest.py +89 -0
  61. amv_vision-2.0.0/amv_vision/vlm/memory.py +115 -0
  62. amv_vision-2.0.0/amv_vision/vlm/model_hub.py +150 -0
  63. amv_vision-2.0.0/amv_vision/vlm/pipeline.py +76 -0
  64. amv_vision-2.0.0/amv_vision/vlm/protocol.py +122 -0
  65. amv_vision-2.0.0/amv_vision/vlm/result.py +35 -0
  66. amv_vision-2.0.0/amv_vision/vlm/runtime/resolver.py +166 -0
  67. amv_vision-2.0.0/amv_vision/vlm/runtime/subprocess.py +263 -0
  68. amv_vision-2.0.0/amv_vision/vlm/supervisor.py +192 -0
  69. amv_vision-2.0.0/amv_vision.egg-info/PKG-INFO +359 -0
  70. amv_vision-2.0.0/amv_vision.egg-info/SOURCES.txt +92 -0
  71. amv_vision-2.0.0/amv_vision.egg-info/dependency_links.txt +1 -0
  72. amv_vision-2.0.0/amv_vision.egg-info/entry_points.txt +5 -0
  73. amv_vision-2.0.0/amv_vision.egg-info/requires.txt +18 -0
  74. amv_vision-2.0.0/amv_vision.egg-info/top_level.txt +2 -0
  75. amv_vision-2.0.0/pyproject.toml +67 -0
  76. amv_vision-2.0.0/setup.cfg +4 -0
  77. amv_vision-2.0.0/termux_vision/__init__.py +55 -0
  78. amv_vision-2.0.0/tests/test_adversarial_sniper_audit.py +89 -0
  79. amv_vision-2.0.0/tests/test_amv_train_bridge.py +48 -0
  80. amv_vision-2.0.0/tests/test_audit_scorecard.py +192 -0
  81. amv_vision-2.0.0/tests/test_boundary_security.py +35 -0
  82. amv_vision-2.0.0/tests/test_cv_filters.py +63 -0
  83. amv_vision-2.0.0/tests/test_detect_haar.py +36 -0
  84. amv_vision-2.0.0/tests/test_gpu_runtime_guard.py +77 -0
  85. amv_vision-2.0.0/tests/test_io_transforms.py +69 -0
  86. amv_vision-2.0.0/tests/test_legacy_import_alias.py +30 -0
  87. amv_vision-2.0.0/tests/test_safetensors_and_models.py +44 -0
  88. amv_vision-2.0.0/tests/test_tvrp_v1.py +77 -0
  89. amv_vision-2.0.0/tests/test_v020_smoke_suite.py +207 -0
  90. amv_vision-2.0.0/tests/test_vlm_advanced_parameters_and_guards.py +148 -0
  91. amv_vision-2.0.0/tests/test_vlm_cluster.py +197 -0
  92. amv_vision-2.0.0/tests/test_vlm_module.py +56 -0
  93. amv_vision-2.0.0/tests/test_vlm_rpc.py +142 -0
  94. amv_vision-2.0.0/tests/test_vlm_user_experience_and_errors.py +237 -0
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or exemplary damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include amv_vision *.py
4
+ global-exclude *.cpp *.h *.spv.h *.c *.so
@@ -0,0 +1,17 @@
1
+ amv-vision
2
+ Copyright 2026 amv-vision contributors
3
+
4
+ This product includes software developed by the amv-vision project
5
+ (https://github.com/uno-km/amv-vision).
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
@@ -0,0 +1,359 @@
1
+ Metadata-Version: 2.4
2
+ Name: amv-vision
3
+ Version: 2.0.0
4
+ Summary: Computer vision, image processing, and VLM multimodal inference for Termux utilizing device resources for Android Termux
5
+ Author: amv-vision contributors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://uno-km.vercel.app/lib/vision/
8
+ Project-URL: Documentation, https://uno-km.vercel.app/lib/vision/
9
+ Project-URL: Repository, https://github.com/uno-km/amv-vision
10
+ Project-URL: Issues, https://github.com/uno-km/amv-vision/issues
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Operating System :: Android
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ License-File: NOTICE
27
+ Requires-Dist: numpy>=1.20.0
28
+ Requires-Dist: Pillow>=8.0.0
29
+ Requires-Dist: amv-llamacpp>=1.3.0
30
+ Provides-Extra: gpu
31
+ Requires-Dist: ameva-runtime>=2.0.0; extra == "gpu"
32
+ Provides-Extra: llamacpp
33
+ Requires-Dist: amv-llamacpp>=0.1.0; extra == "llamacpp"
34
+ Requires-Dist: ameva-component-sdk<2.0,>=0.1.0; extra == "llamacpp"
35
+ Provides-Extra: train
36
+ Requires-Dist: amv-train>=0.1.0; extra == "train"
37
+ Provides-Extra: all
38
+ Requires-Dist: amv-llamacpp>=0.1.0; extra == "all"
39
+ Requires-Dist: ameva-component-sdk<2.0,>=0.1.0; extra == "all"
40
+ Requires-Dist: amv-train>=0.1.0; extra == "all"
41
+ Dynamic: license-file
42
+
43
+ # AMV-Vision: On-Device Computer Vision & Multimodal VLM Framework
44
+
45
+ > **마이그레이션 안내**: 이 패키지는 `termux-vision`에서 `amv-vision`로 이름이 바뀌었습니다. 기존 `termux-vision` 배포본(PyPI/npm)은 호환을 위해 당분간 유지되나 deprecated 상태이며 더 이상 갱신되지 않습니다. `pip install amv-vision` / `npm install amv-vision`로 전환하십시오.
46
+ >
47
+ > Android **Termux 환경** 또는 **안드로이드 Linux 커널(루팅 없이 Linux 환경이 구동되는 모든 디바이스)** 에서 동작합니다 — Termux 전용이 아닙니다.
48
+
49
+ [![PyPI](https://img.shields.io/pypi/v/amv-vision.svg?style=flat-square&color=0369a1)](https://pypi.org/project/amv-vision/)
50
+ [![Python](https://img.shields.io/pypi/pyversions/amv-vision.svg?style=flat-square)](https://pypi.org/project/amv-vision/)
51
+ [![npm](https://img.shields.io/npm/v/amv-vision.svg?style=flat-square&color=b91c1c)](https://www.npmjs.com/package/amv-vision)
52
+ [![npm downloads](https://img.shields.io/npm/dm/amv-vision.svg?style=flat-square&color=b91c1c)](https://www.npmjs.com/package/amv-vision)
53
+ [![License](https://img.shields.io/badge/License-Apache_2.0-004499.svg?style=flat-square)](https://github.com/uno-km/amv-vision)
54
+ [![Hardware Acceleration](https://img.shields.io/badge/Vulkan-1.1%2B%20Compute-orange?style=flat-square&logo=vulkan)](https://www.vulkan.org/)
55
+
56
+ > **Native On-Device Computer Vision & Multimodal Vision-Language Model (VLM) Runtime for Android Termux via Direct Bionic libc & Vulkan Compute Acceleration.**
57
+ > *Zero PRoot. Zero Virtualization. 100% Native ARMv8.2-A NEON SIMD & Hardware GPU Offloading.*
58
+
59
+ ---
60
+
61
+ ## What's New in v1.8.0 — Unified ameva-runtime HAL & OpenSSF Governance
62
+
63
+ - Routed all VLM vision GPU acceleration requests through unified ameva-runtime HAL.
64
+ - Synchronized GitHub Release tags with npm and PyPI registry versions.
65
+ - Standardized Apache-2.0 SPDX license headers and POSIX LF line endings.
66
+
67
+ ---
68
+
69
+ ## 📑 Table of Contents
70
+
71
+ 1. [Overview & Key Capabilities](#1-overview--key-capabilities)
72
+ 2. [Installation Guide & Prebuilt Installer](#2-installation-guide--prebuilt-installer)
73
+ 3. [Enabling Hardware GPU Acceleration (with ameva-runtime)](#3-enabling-hardware-gpu-acceleration-with-ameva-runtime)
74
+ 4. [Standardized CLI & Parameter Matrix](#4-standardized-cli--parameter-matrix)
75
+ 5. [Dual Engine Code Examples (Python & Node.js)](#5-dual-engine-code-examples-python--nodejs)
76
+ 6. [Production Diagnostics (`amv-vision doctor`)](#6-production-diagnostics-amv-vision-doctor)
77
+ 7. [Real-World Benchmarks & Hardware Scorecard](#7-real-world-benchmarks--hardware-scorecard)
78
+ 8. [Memory & VRAM Architecture (Zero CPU-Mapped VRAM)](#8-memory--vram-architecture)
79
+ 9. [Hardware Requirements & Operational Limits](#9-hardware-requirements--operational-limits)
80
+ 10. [License & Permissible Use](#10-license--permissible-use)
81
+
82
+ ---
83
+
84
+ ## 1. Overview & Key Capabilities
85
+
86
+ `amv-vision` is an enterprise-grade, on-device multimodal vision inference and spatial computing framework engineered specifically for mobile Android devices. Operating directly against Android's native Bionic libc ABI and host Vulkan compute drivers, `amv-vision` eliminates heavyweight desktop dependencies (OpenCV, TorchVision) and enables high-throughput visual question answering, OCR image captioning, and classical feature extraction directly on edge hardware.
87
+
88
+ * **100% Vulkan GPU Compute Canny (`0.23 ms`)**: Chains 3-pass SPIR-V compute shaders (Sobel 3x3, NMS, Hysteresis) entirely within VRAM using `vkCmdPipelineBarrier`, achieving 834x acceleration over Python without CPU memory roundtrips.
89
+ * **Ultra-Fast ARM64 NEON C++ Kernel (`3.02 ms`)**: Permanently eliminates trigonometric `atan2f` via tangent ratio bit quantization and 1-byte direction buffers, running Canny filtering in 3.02ms on Snapdragon 865 and 4.36ms on Exynos 1380.
90
+ * **Prebuilt-Asset-First Idempotent Installer (`0.005s Skip`)**: Automatically provisions verified precompiled ARM64 native binaries in 2 seconds from official releases, guaranteeing zero-build instant skip if assets already exist.
91
+ * **5-Backend Unified CLI Standard**: Enforces `['auto', 'gpu', 'vulkan', 'opencl', 'cpu']` and convenience flags (`--gpu`, `--cpu`, `--opencl`) across all subcommands.
92
+ * **Zero-Deception Fail-Fast Gatekeeper**: Strictly rejects defective text-only binaries lacking `--mmproj` (`E015`) and corrupted weights (`E014`), permanently banning silent fallbacks.
93
+ * **Full-Layer GPU Offloading (-ngl 99)**: Dispatches all transformer layers and cross-attention vision projections directly to device GPU VRAM (**0.00 MiB CPU mapped VRAM**).
94
+
95
+ ---
96
+
97
+ ## 2. Installation Guide & Prebuilt Installer
98
+
99
+ `amv-vision` is distributed across both Python (PyPI) and Node.js (npm) ecosystems, with official precompiled ARM64 wheel assets published on GitHub Releases.
100
+
101
+ ### 2.1 Termux System Prerequisites
102
+ Launch Termux and install required native compilers, Vulkan drivers, and image libraries:
103
+ ```bash
104
+ pkg update -y
105
+ pkg install -y python nodejs clang make cmake git termux-api wget vulkan-loader vulkan-headers vulkan-tools opencl-headers python-numpy libjpeg-turbo
106
+ ```
107
+
108
+ ### 2.2 Python Package Installation
109
+
110
+ * **Option A: Install from PyPI (Recommended)**:
111
+ ```bash
112
+ pip install --upgrade pip setuptools wheel
113
+ pip install amv-vision
114
+ ```
115
+
116
+ * **Option B: Prebuilt Native Engine Provisioning (Idempotent 0.005s)**:
117
+ ```bash
118
+ # Automatically download & unpack verified ARM64 prebuilt assets
119
+ amv-vision install
120
+
121
+ # Optional maintenance flags:
122
+ # amv-vision install --force # Force re-downloading prebuilts
123
+ # amv-vision install --from-source # Force compiling from local C++ source
124
+ # amv-vision install --dry-run # Check integrity without making changes
125
+ ```
126
+
127
+ * **Option C: Direct GitHub Releases Wheel Asset**:
128
+ ```bash
129
+ # Download and install the prebuilt v1.5.0 release wheel
130
+ pip install https://github.com/uno-km/amv-vision/releases/download/v1.5.0/amv_vision-1.5.0-py3-none-any.whl
131
+ ```
132
+
133
+ ### 2.3 Node.js / TypeScript CLI Installation
134
+ ```bash
135
+ # Global CLI installation
136
+ npm install -g amv-vision
137
+
138
+ # Local project dependency
139
+ npm install amv-vision
140
+ ```
141
+
142
+ ### 2.4 One-Line Bootstrap Installer
143
+ Run the universal bootstrap installer to automatically configure repositories, compile native C/C++ acceleration shims, and verify hardware:
144
+ ```bash
145
+ curl -sL https://raw.githubusercontent.com/uno-km/amv-vision/main/install.sh | bash
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 3. Enabling Hardware GPU Acceleration (with ameva-runtime)
151
+
152
+ To unlock mobile GPU acceleration via Vulkan compute shaders and achieve significant speedups over pure CPU execution, install **`amv-vision`** alongside **`ameva-runtime`**:
153
+
154
+ ### 🌟 One-Line Installation
155
+ ```bash
156
+ # Python Environment
157
+ pip install amv-vision ameva-runtime amv-llamacpp
158
+
159
+ # Node.js Environment
160
+ npm install -g amv-vision @ameva/runtime
161
+ ```
162
+
163
+ ### 🔮 Mobile GPU Silicon Architecture Status
164
+
165
+ | GPU Microarchitecture | Silicon / SoC Reference | Status | Optimization Mechanics |
166
+ | :--- | :--- | :--- | :--- |
167
+ | **Qualcomm Adreno GPU** | Snapdragon 8 Elite (Adreno 830)<br>Snapdragon 8 Gen 1/2/3 (Adreno 730-750)<br>Snapdragon 865 (Adreno 650) | 🟢 **Production Verified** | Direct Bionic ICD binding, SPIR-V JIT patch (`mul_mat_vec_max_cols = 2`), KGSL Watchdog defense (`GGML_VULKAN_SKIP_CHECKS="999999999"`), micro-batch prefill chunking (`-b 64 -ub 64`). |
168
+ | **ARM Mali GPU** | Exynos 2100 (Mali-G78 MP14)<br>Exynos 1380 (Mali-G68 MP5) | 🟢 **Production Verified** | Bionic Vulkan ICD binding, Tile-Based Deferred Rendering (TBDR) memory isolation, MMVQ matrix-vector kernel dispatch (`--tune-mali`). |
169
+ | **Samsung Xclipse GPU** | Exynos 2200 / 2400<br>(Xclipse 920 / 940 - AMD RDNA) | 🟡 **In Development (개발 진행 중)** | SPIR-V instruction scheduling and RDNA mobile shader alignment under active engineering. |
170
+
171
+ Verify GPU driver detection and hardware readiness:
172
+ ```bash
173
+ amv-vision doctor
174
+ ```
175
+
176
+ ---
177
+
178
+ ## 4. Standardized CLI & Parameter Matrix
179
+
180
+ `amv-vision` strictly complies with the official `uno-km` family 5-backend CLI standard:
181
+
182
+ | Parameter | Alias | Default | Description |
183
+ | :--- | :--- | :--- | :--- |
184
+ | `-b, --backend` | `-d, --device` | `auto` | Compute acceleration backend: `auto`, `gpu`, `vulkan`, `opencl`, `cpu` |
185
+ | `--gpu` / `--cpu` / `--opencl` | *N/A* | *None* | Convenience shorthand flags for backend routing |
186
+ | `-i, --image` | `--image-path` | *Required* | Path to input image (`.png`, `.jpg`, `.webp`) |
187
+ | `-p, --prompt` | *N/A* | `"Describe this image"` | Multimodal text instruction query |
188
+ | `-m, --model` | *N/A* | `smolvlm-500m` | GGUF language model path or catalog identifier |
189
+ | `--mmproj` | *N/A* | *Auto-paired* | Vision projector GGUF model path (`mmproj-*.gguf`) |
190
+ | `-n, --max-tokens` | `--n-predict` | `150` | Maximum number of generated tokens |
191
+ | `-c, --ctx-size` | `--ctx` | `2048` | Context window size |
192
+ | `-t, --threads` | *N/A* | `auto` | Number of CPU execution threads |
193
+ | `--image-size` | *N/A* | *None* | Image resolution preset (e.g. `224x224`, `384x384`) |
194
+ | `-q, --quality` | *N/A* | `optimal` | 4-tier resolution preset: `fast` (384px), `optimal` (768px), `high` (1280px), `original` (1:1) |
195
+ | `--tune-mali` | *N/A* | `False` | Enable ARM Mali GPU MMVQ tuning (`GGML_VK_FORCE_MMVQ=1`) |
196
+ | `--json` | *N/A* | `False` | Emit machine-readable JSON benchmark telemetry |
197
+ | `-v, --verbose` | *N/A* | `False` | Print detailed layer offloading and hardware logs |
198
+
199
+ ### Practical CLI Usage Examples
200
+
201
+ ```bash
202
+ # 1. 100% Vulkan GPU Canny Edge Detection (0.23 ms on Adreno 830)
203
+ amv-vision canny photo.jpg -o edges.png --gpu --low 40 --high 120
204
+
205
+ # 2. Ultra-Fast NEON C++ Canny Edge Detection (3.02 ms on S20 CPU)
206
+ amv-vision canny photo.jpg -o edges.png --cpu
207
+
208
+ # 3. Multimodal VLM Inference with Automated GPU Routing
209
+ amv-vision vlm photo.jpg -p "What objects are visible in this scene?"
210
+
211
+ # 4. Pure GPU Mode on ARM Mali Silicon (Galaxy S21 / A35)
212
+ amv-vision vlm photo.jpg -d gpu --tune-mali -p "Describe the text and layout."
213
+
214
+ # 5. Prebuilt Native Binary Provisioning (0.005s Idempotent Skip)
215
+ amv-vision install
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 5. Dual Engine Code Examples (Python & Node.js)
221
+
222
+ ### 5.1 Python SDK
223
+ ```python
224
+ import amv_vision as tv
225
+
226
+ # 1. Hardware-Accelerated Canny Edge Detection (0.23ms Vulkan GPU / 3.02ms NEON CPU)
227
+ image = tv.io.load_image("document.jpg")
228
+ grayscale = tv.transforms.to_grayscale(image)
229
+ edges = tv.cv.canny(grayscale, low_threshold=40, high_threshold=120, backend="auto")
230
+ tv.io.save_image(edges, "edges.png")
231
+
232
+ # 2. On-Device Multimodal VLM Inference (Vulkan GPU Accelerated)
233
+ with tv.vlm.load("smolvlm-500m", device="gpu") as engine:
234
+ result = engine.describe(
235
+ "document.jpg",
236
+ prompt="Extract all visible text and summarize key bullet points.",
237
+ quality="optimal",
238
+ max_tokens=200
239
+ )
240
+ print(f"Backend: {result.metrics.backend} | TPS: {result.metrics.tokens_per_second:.2f} tok/s")
241
+ print(f"Response:
242
+ {result.text}")
243
+ ```
244
+
245
+ ### 5.2 Node.js / TypeScript SDK
246
+ ```typescript
247
+ import tv from 'amv-vision';
248
+
249
+ // 1. Hardware Diagnostic Probe
250
+ const doctor = tv.doctor(true);
251
+ console.log(`Vulkan GPU: ${doctor.vulkan.status} | Available RAM: ${doctor.hardware.availableRamMb} MB`);
252
+
253
+ // 2. Multimodal VLM Inference
254
+ const engine = await tv.load({ modelId: 'smolvlm-500m', device: 'gpu' });
255
+ const response = await engine.describe('photo.jpg', {
256
+ prompt: 'Identify the geometric shapes and colors.',
257
+ quality: 'optimal',
258
+ maxTokens: 100
259
+ });
260
+
261
+ console.log(`[${response.metrics.backend.toUpperCase()}] ${response.text}`);
262
+ engine.close();
263
+ ```
264
+
265
+ ---
266
+
267
+ ## 6. Production Diagnostics (`amv-vision doctor`)
268
+
269
+ AMV-Vision features an integrated hardware diagnostics probe to inspect the host environment before launching inference:
270
+
271
+ ```bash
272
+ amv-vision doctor
273
+ ```
274
+
275
+ **Diagnostic Output Profile:**
276
+ ```
277
+ === amv-vision Diagnostic Doctor ===
278
+ Platform : Linux (aarch64) | Android: True
279
+ RAM : Total 7812MB | Available 3450MB
280
+ CPU Cores: 8 (big.LITTLE Affinity Governor active)
281
+ Vulkan : Loader=True | Driver=/system/lib64/libvulkan.so | Status=READY
282
+ GPU Soc : ARM Mali-G78 MP14 (Exynos 2100)
283
+ Models : 2 installed in ~/.cache/amv-vision/models
284
+ Preset : optimal (768px recommended)
285
+ ```
286
+
287
+ ---
288
+
289
+ ## 7. Real-World Benchmarks & Hardware Scorecard
290
+
291
+ ### 7.1 Classical Vision Filtering Latency (512x512 Image, Physical Devices)
292
+
293
+ | Algorithm / Kernel | Architecture / Acceleration | Execution Latency | Memory Overhead | Status / Verified Device |
294
+ | :--- | :--- | :--- | :--- | :--- |
295
+ | **100% Vulkan GPU Compute Canny** | **3-Pass SPIR-V Compute VRAM Chain** | **0.23 ms (Min 0.18 ms)** | **0.00 MiB CPU VRAM** | **Production (S25 Adreno 830, 834x Speedup)** |
296
+ | **ARM64 NEON C++ Canny Engine** | **Tangent-Ratio Bit Quantization (No atan2f)** | **3.02 ms ~ 3.42 ms** | **1.0 MB (uint8 buffer)** | **Production (S20: 3.02ms, S25: 3.42ms)** |
297
+ | ARM64 NEON C++ Canny Engine | Exynos 1380 Cortex-A78 NEON | 4.36 ms | 1.0 MB | Production (Galaxy A35) |
298
+ | Sobel 3x3 Gradient Convolution | ARM NEON Vectorized | 1.1 ms | 0.5 MB | Production |
299
+ | Gaussian Blur 5x5 Kernel | Separable 1D Conv | 1.8 ms | 0.5 MB | Production |
300
+ | 2D Integral Image (SAT) | Row/Col Prefix Sum | 1.2 ms | 2.0 MB | Production |
301
+ | Haar Cascade Face Detection | Candidate Classifier | 12.5 ms | 2.2 MB | Production |
302
+
303
+ ### 7.2 On-Device Multimodal VLM Benchmark
304
+
305
+ | Target Device | SoC & GPU Architecture | Model Architecture | Mode | Prompt Processing | Token Generation | Mapped CPU VRAM | Vulkan GPU VRAM | Status / Speedup |
306
+ | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
307
+ | **Samsung Galaxy S25** | Snapdragon 8 Elite<br>Adreno 830 | **Moondream2 1.8B f16** | **GPU (Vulkan 25/25)** | **19.84 tok/s** | **15.00 tok/s** | **0.00 MiB** | **2,706.00 MiB** | **Production Verified** |
308
+ | **Samsung Galaxy S21 5G** | Exynos 2100<br>Mali-G78 MP14 | SmolVLM-500M-Instruct | **GPU (Vulkan)** | **14.28 tok/s** | **12.65 tok/s** | **0.00 MiB** | **1,059.02 MiB** | **+58.9% vs CPU** |
309
+ | Samsung Galaxy S21 5G | Exynos 2100<br>8-Core CPU | SmolVLM-500M-Instruct | CPU (NEON) | 8.84 tok/s | 7.96 tok/s | 1,059.02 MiB | 0.00 MiB | Baseline |
310
+ | **Samsung Galaxy A35 5G** | Exynos 1380<br>Mali-G68 MP5 | SmolVLM-500M-Instruct | **GPU (Vulkan)** | **5.67 tok/s** | **5.47 tok/s** | **0.00 MiB** | **1,059.02 MiB** | **+55.8% vs CPU** |
311
+ | Samsung Galaxy A35 5G | Exynos 1380<br>8-Core CPU | SmolVLM-500M-Instruct | CPU (NEON) | 4.88 tok/s | 3.51 tok/s | 1,059.02 MiB | 0.00 MiB | Baseline |
312
+
313
+ ---
314
+
315
+ ## 8. Memory & VRAM Architecture
316
+
317
+ ```
318
+ +---------------------------------------------------------------+
319
+ | Physical Mobile LPDDR4X/LPDDR5 RAM (8 GB) |
320
+ +---------------------------------------------------------------+
321
+ | |
322
+ v v
323
+ +-------------------------------+ +-------------------------------+
324
+ | Android OS & Framework | | Termux User Space |
325
+ | (~3.5 - 4.2 GB) | | (~3.8 - 4.5 GB) |
326
+ +-------------------------------+ +-------------------------------+
327
+ |
328
+ v
329
+ +-------------------------------+
330
+ | Vulkan Unified Memory |
331
+ | - Model Weights: 1059.02 MiB |
332
+ | - KV Cache : 384.00 MiB |
333
+ | - CPU Mapped : 0.00 MiB |
334
+ +-------------------------------+
335
+ ```
336
+
337
+ ---
338
+
339
+ ## 9. Hardware Requirements & Operational Limits
340
+
341
+ | Requirement | Minimum Specification | Recommended Specification |
342
+ | :--- | :--- | :--- |
343
+ | **Operating System** | Android 10+ (Termux ARM64) | Android 13+ (One UI 5.0+ / Termux Bionic) |
344
+ | **Processor (SoC)** | 8-Core ARM64 (Cortex-A55/A76) | Exynos 2100 / Snapdragon 8 Gen 2 or newer |
345
+ | **System RAM** | 6 GB LPDDR4X | 8 GB+ LPDDR5 |
346
+ | **Vulkan API** | Vulkan 1.1 with SPIR-V Compute | Vulkan 1.2+ with Subgroup 16 arithmetic |
347
+ | **Free Storage** | 2.5 GB internal storage | 6.0 GB internal storage |
348
+
349
+ ---
350
+
351
+ ## 10. License & Permissible Use
352
+
353
+ Licensed under the **Apache License, Version 2.0**.
354
+ Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)) & AMEVA Open-Source Foundation (AOSF).
355
+
356
+ * [Official Documentation Portal](https://uno-km.vercel.app/lib/vision/)
357
+ * [AMEVA Open-Source Foundation](https://uno-km.vercel.app/foundation/index.html)
358
+ * [GitHub Repository](https://github.com/uno-km/amv-vision)
359
+ * [Issue Tracker](https://github.com/uno-km/amv-vision/issues)