termux-vision 1.7.0 → 1.8.0
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.
- package/README.md +2 -45
- package/README.pypi.md +1 -1
- package/bin/cli.js +4 -0
- package/index.d.ts +101 -97
- package/index.js +36 -32
- package/lib/cache.js +321 -317
- package/lib/cv.js +146 -142
- package/lib/detect.js +135 -131
- package/lib/doctor.js +92 -88
- package/lib/errors.js +125 -121
- package/lib/vlm.js +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -72,8 +72,8 @@ pkg install -y python nodejs clang make cmake git termux-api wget vulkan-loader
|
|
|
72
72
|
|
|
73
73
|
* **Option C: Direct GitHub Releases Wheel Asset**:
|
|
74
74
|
```bash
|
|
75
|
-
# Download and install the prebuilt v1.
|
|
76
|
-
pip install https://github.com/uno-km/termux-vision/releases/download/v1.
|
|
75
|
+
# Download and install the prebuilt v1.5.0 release wheel
|
|
76
|
+
pip install https://github.com/uno-km/termux-vision/releases/download/v1.5.0/termux_vision-1.5.0-py3-none-any.whl
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
### 2.3 Node.js / TypeScript CLI Installation
|
|
@@ -281,49 +281,6 @@ termux-vision doctor
|
|
|
281
281
|
|
|
282
282
|
---
|
|
283
283
|
|
|
284
|
-
## Distributed Clustering & Memory Pooling (AMEVA-Cluster)
|
|
285
|
-
|
|
286
|
-
Termux-Vision integrates with **AMEVA-Cluster** (`pip install ameva-cluster`) for distributed multimodal VLM inference across interconnected mobile fleets.
|
|
287
|
-
|
|
288
|
-
### 1. Install Cluster Runtime
|
|
289
|
-
```bash
|
|
290
|
-
pip install ameva-cluster
|
|
291
|
-
# or Node.js:
|
|
292
|
-
npm install @ameva/cluster
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### 2. Launch Worker Node on Remote Phone
|
|
296
|
-
```bash
|
|
297
|
-
# On remote worker device (e.g. Galaxy A53):
|
|
298
|
-
ameva-cluster worker --port 50052
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### 3. Distributed VLM Image Analysis
|
|
302
|
-
```bash
|
|
303
|
-
# Master node running VLM inference sharded across remote phone RAM:
|
|
304
|
-
termux-vision analyze \
|
|
305
|
-
--model Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf \
|
|
306
|
-
--mmproj mmproj-Qwen2.5-VL-7B.gguf \
|
|
307
|
-
--image scene.jpg \
|
|
308
|
-
--rpc 192.0.2.10:50052,192.0.2.11:50052 \
|
|
309
|
-
-p "Detailed description of all objects in this image."
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
```python
|
|
313
|
-
from termux_vision import vlm
|
|
314
|
-
|
|
315
|
-
# Python SDK Distributed VLM
|
|
316
|
-
engine = vlm.load(
|
|
317
|
-
"Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf",
|
|
318
|
-
mmproj="mmproj-Qwen2.5-VL-7B.gguf",
|
|
319
|
-
cluster_rpc_servers="192.0.2.10:50052,192.0.2.11:50052"
|
|
320
|
-
)
|
|
321
|
-
res = engine.generate("scene.jpg", prompt="Describe the image.")
|
|
322
|
-
print(res.text)
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
284
|
## 9. Hardware Requirements & Operational Limits
|
|
328
285
|
|
|
329
286
|
| Requirement | Minimum Specification | Recommended Specification |
|
package/README.pypi.md
CHANGED
|
@@ -39,7 +39,7 @@ termux-vision install
|
|
|
39
39
|
|
|
40
40
|
### 2.3 Direct GitHub Releases Wheel Asset
|
|
41
41
|
```bash
|
|
42
|
-
pip install https://github.com/uno-km/termux-vision/releases/download/v1.
|
|
42
|
+
pip install https://github.com/uno-km/termux-vision/releases/download/v1.5.0/termux_vision-1.5.0-py3-none-any.whl
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### 2.4 One-Line Bootstrap Installer
|
package/bin/cli.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026 Uno Kim / AMEVA Foundation. All rights reserved.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0 OR Commercial-License
|
|
5
|
+
*/
|
|
2
6
|
/**
|
|
3
7
|
* AMEVA Standard Node.js CLI Runner for termux_vision.
|
|
4
8
|
* Automatically resolves Python 3 environment and dispatches to python -m termux_vision.
|
package/index.d.ts
CHANGED
|
@@ -1,97 +1,101 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export namespace
|
|
74
|
-
export function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export
|
|
80
|
-
export function
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export namespace
|
|
84
|
-
export function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export
|
|
89
|
-
export
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 Uno Kim / AMEVA Foundation. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR Commercial-License
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Type declarations for termux-vision Node.js SDK
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface VLMDescribeOptions {
|
|
10
|
+
prompt?: string;
|
|
11
|
+
maxTokens?: number;
|
|
12
|
+
temperature?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface InferenceMetrics {
|
|
16
|
+
backend: string;
|
|
17
|
+
modelId: string;
|
|
18
|
+
decodeMs: number;
|
|
19
|
+
tokensPerSecond?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface VLMResult {
|
|
23
|
+
text: string;
|
|
24
|
+
finishReason: string;
|
|
25
|
+
wordCount: number;
|
|
26
|
+
metrics: InferenceMetrics;
|
|
27
|
+
warnings: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface VLMContext {
|
|
31
|
+
describe(imagePath: string, options?: VLMDescribeOptions): Promise<VLMResult>;
|
|
32
|
+
ask(imagePath: string, question: string): Promise<string>;
|
|
33
|
+
close(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface LoadOptions {
|
|
37
|
+
modelId?: string;
|
|
38
|
+
device?: 'auto' | 'cpu' | 'vulkan' | 'gpu' | 'vulkan-force';
|
|
39
|
+
threads?: number | 'auto';
|
|
40
|
+
runtimePath?: string;
|
|
41
|
+
mmprojPath?: string;
|
|
42
|
+
allowDownload?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface DiagnosticReport {
|
|
46
|
+
schemaVersion: number;
|
|
47
|
+
platform: {
|
|
48
|
+
system: string;
|
|
49
|
+
machine: string;
|
|
50
|
+
isAndroid: boolean;
|
|
51
|
+
};
|
|
52
|
+
hardware: {
|
|
53
|
+
cpuCores: number;
|
|
54
|
+
totalRamMb: number | null;
|
|
55
|
+
availableRamMb: number | null;
|
|
56
|
+
};
|
|
57
|
+
vulkan: {
|
|
58
|
+
loaderDetected: boolean;
|
|
59
|
+
driverDetected: boolean;
|
|
60
|
+
status: string;
|
|
61
|
+
};
|
|
62
|
+
modelsCount: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ModelInfo {
|
|
66
|
+
modelId: string;
|
|
67
|
+
tier: string;
|
|
68
|
+
state: string;
|
|
69
|
+
sizeMb: number;
|
|
70
|
+
path: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export namespace vlm {
|
|
74
|
+
export function load(options?: LoadOptions): Promise<VLMContext>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export namespace cache {
|
|
78
|
+
export function listInstalled(): ModelInfo[];
|
|
79
|
+
export function install(modelId: string, onProgress?: (file: string, downloaded: number, total: number) => void): Promise<void>;
|
|
80
|
+
export function remove(modelId: string): boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export namespace doctor {
|
|
84
|
+
export function run(probeVulkan?: boolean): DiagnosticReport;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export namespace cv {
|
|
88
|
+
export function canny(grayPixels: Uint8Array, width: number, height: number, low?: number, high?: number): Uint8Array;
|
|
89
|
+
export function sobel(grayPixels: Uint8Array, width: number, height: number): { gradX: Float32Array; gradY: Float32Array; magnitude: Float32Array };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export namespace detect {
|
|
93
|
+
export interface BBox {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
width: number;
|
|
97
|
+
height: number;
|
|
98
|
+
score?: number;
|
|
99
|
+
}
|
|
100
|
+
export function nms(boxes: BBox[], iouThreshold?: number): BBox[];
|
|
101
|
+
}
|
package/index.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 Uno Kim / AMEVA Foundation. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR Commercial-License
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* termux-vision: Native On-Device Computer Vision & VLM Multimodal Inference Framework.
|
|
7
|
+
* Dual-Engine (Python & Node.js/TypeScript) Native Module for Android Termux & ARM64.
|
|
8
|
+
* Open-Source under Apache License 2.0.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const errors = require('./lib/errors');
|
|
14
|
+
const cache = require('./lib/cache');
|
|
15
|
+
const vlm = require('./lib/vlm');
|
|
16
|
+
const doctor = require('./lib/doctor');
|
|
17
|
+
const cv = require('./lib/cv');
|
|
18
|
+
const detect = require('./lib/detect');
|
|
19
|
+
|
|
20
|
+
const packageJson = require('./package.json');
|
|
21
|
+
const version = packageJson.version;
|
|
22
|
+
const cacheManager = new cache.ModelCacheManager();
|
|
23
|
+
cacheManager.ModelCacheManager = cache.ModelCacheManager;
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
version,
|
|
27
|
+
__version__: version,
|
|
28
|
+
errors,
|
|
29
|
+
cache: cacheManager,
|
|
30
|
+
ModelCacheManager: cache.ModelCacheManager,
|
|
31
|
+
vlm,
|
|
32
|
+
load: vlm.load,
|
|
33
|
+
doctor: doctor.runDoctor,
|
|
34
|
+
cv,
|
|
35
|
+
detect
|
|
36
|
+
};
|