API Reference
Complete technical specification of classes, modules, and functions
1. Module: termux_vision.vlm
load(model_id, device='auto', threads='auto', ...) -> VLMContext
Loads a VLM inference engine context manager.
model_id(str): Catalog preset (e.g.'smolvlm-500m-q4'), custom name, or direct.ggufpath.device(str):'auto'(Vulkan with CPU fallback),'gpu'/'vulkan'(strict Vulkan only), or'cpu'.threads(int | str): Thread count (default 4).mmproj_path(Optional[str]): Explicit path to vision projector mmproj file.
VLMContext.describe(image, prompt=None, max_tokens=150, temperature=0.2, ...) -> VLMResult
Performs visual image description with strict parameter validation.
2. Module: termux_vision.cv
canny(image, low_threshold=40.0, high_threshold=120.0) -> np.ndarray
Executes pure NumPy 5-stage Canny Edge Detection with double-threshold hysteresis.
sobel(image) -> Tuple[np.ndarray, np.ndarray, np.ndarray]
Computes Sobel 3x3 horizontal, vertical gradients, and magnitude map.
3. Module: termux_vision.detect
detect_faces(image) -> List[Detection]
Scans candidate face regions using an integral-image Haar Cascade classifier with Non-Maximum Suppression (NMS).
4. Module: termux_vision.cli.doctor
run_doctor(probe_vulkan=False) -> dict
Inspects platform architecture, RAM availability, CPU core count, and Vulkan GPU driver presence.