Zero external classic CV libraries, 0.46 ms single-pass SIMD preprocessing, evolving from a 7-stage Hybrid Neuro-Transformer to a 2.18 MB detector, and real multi-hardware telemetry from RTX GPUs to physical Raspberry Pi 5.

Most real-time computer vision stacks are stitched together from loosely coupled pieces: an external image processing library for decoding and resizing, a deep learning runtime, ad-hoc post-processing scripts, and custom deployment wrappers. That works well for notebooks — until you deploy into dense, occluded agricultural canopies, continuous industrial streams, or memory-constrained edge devices.
Suddenly, copying every 1080p frame across DRAM three times for resize, letterbox, and normalization saturates memory bandwidth. Long training runs suffer opaque memory creep across operating systems. And at operational confidence thresholds (conf=0.25), detectors collapse to zero detections on dense clusters of sub-32×32 px targets.
SpaceTeknopoliVision (STV) was built from scratch in C++20 and PyTorch to solve this stack vertically — with zero external classic computer vision library dependencies. Because the core engine and our inaugural v3 detector family were written in Niš, Serbia, we codenamed our first v3 family “Reka Nišava” after the Nišava River flowing through the city.
One misconception worth clearing up immediately: STV is not a Raspberry Pi 5-only toy. It is a multi-platform vision runtime verified across NVIDIA RTX workstations (54.54 FPS, 17.62 W), multi-core Linux and Windows x86_64 servers (52.64 FPS 16T / 42.69 FPS 4T ONNX), Apple Silicon desktops, and physical Raspberry Pi 5 / ARM64 edge hardware.
1. Zero External CV Dependencies: FusedISP, 42 Native STV-CV Ops, and Cross-Platform Memory Governance
On both edge silicon and high-throughput CPUs, preprocessing is often half the latency budget. Instead of running resize, letterbox padding, and uint8 → float32 CHW normalization in three separate memory passes, FusedISPfuses all three into a single ARM NEON / x86 AVX2 vectorized C++20 kernel — cutting 1920×1080 → 640×640 preprocessing to ~0.46 ms.
Intermediate buffers come from a 64-byte cache-line aligned O(1) bump-pointer ArenaPool (single pointer reset per frame, zero heap fragmentation) and cross into PyTorch via DLPack with 0 memcpy. Alongside FusedISP sits STV-CV: 42deterministic native C++20 operators across six canonical domains (Geometry, Filtering, Morphology/CCL, Color, Motion, and PDE/Spectral).

Cross-Platform Dual-Layer Memory Gatekeeper (macOS · Linux · Windows)
Standard POSIX getrusage() only returns historical peak memory on macOS and cannot observe real-time reclamation. In core_cpp/src/core/memory_gatekeeper.cpp, stv::core::MemoryGatekeeperqueries instantaneous kernel-level resident memory across all three major operating systems and triggers active reclamation at 90% of the configured budget:
- macOS (
__APPLE__):task_info(mach_task_self(), TASK_VM_INFO)(phys_footprint) +resident_size_max+malloc_zone_pressure_relief(). - Linux (
__linux__— x86_64 & ARM64 / Pi 5):/proc/self/statm×sysconf(_SC_PAGESIZE)+/proc/self/status(VmHWM) +malloc_trim(0). - Windows (
_WIN32— MSVC 2022):<windows.h>+<psapi.h>GetProcessMemoryInfo(GetCurrentProcess())(WorkingSetSizeandPeakWorkingSetSize).
On the Python training side, O(1) zero-copy ModelEMA.swap() swaps tensor data pointers in place with zero extra allocation.
2. Inside STV-Net: From 7-Stage Hybrid Neuro-Transformer (v2) to "Reka Nišava" (v3)
Both generations live inside the same unified build_stvnet() factory (9model scales spanning 1.045M to 62.90Mparameters):
STV-Net v2–7-Stage Hybrid Neuro-Transformer (stv_net/model.py)
Our v2 architecture integrates true Transformer and multi-scale attention blocks directly into a compact detector:
- Stage 3 (
STVLinearFormerBlock): Combines 2D Rotary Positional Embeddings (2D-RoPE) with O(N)O(N)FocusedLinearAttentionatH/16 × W/16, stabilized by Spectral Covariance Regularization(attn_cov_matrix). - Stage 4 (
STVGlobalTransformerBlock): Full Pre-RMSNorm + SwiGLU global Transformer block with cached 2D Sinusoidal Positional Encoding atH/32 × W/32. - Stage 6 (
STVDeformDecoder): IoU-aware dynamic query selection (100–500queries),nn.MultiheadAttention,MultiScaleDeformableAttentionsubpixel cross-attention, and a Contrastive Denoising (CDN) block-diagonal attention mask during training (0inference overhead). - Attention Adapters & Transformer LoRA:
CoordinateAttention2d,CVFeatureAdapter(gated classical CV + neuro-transformer feature fusion), andLoRA(stv_net/training/lora.py) injected into Linear Attention projections, TransformerQKV, andFFNlayers.
STV-Net v3 — “Reka Nišava” (stv_net/model_v3.py)
To dramatically boost dense small-object recall (<32×32 px) and CPU/Edge throughput, v3 ("Reka Nišava") introduces four focused upgrades:
- Algebraic
RepConv&DWRepBlockFolding (fuse()): Multi-branch training blocks (3×3 + 1×1 + Identity BN) fold losslessly into a single3×3conv at export (Nano v3:2.39Mtrain →1.13Mdeploy params;Small v3:7.31M→3.92M). - Lossless
SPDConvP2ToP3& P5-PrunedSTVBiFPNLite: Prunes35–40%of large-object P5 channels while injecting high-resolution P2 edge features into P3 via lossless2×2Space-to-Depth slicing. - NMS-Free
DualAssignHead (o2m + o2o): Parallelo2m + o2otraining heads;o2mis permanently pruned at export. - CWD + Logit/DFL Knowledge Distillation: Compresses
STVNet-Small v3(7.50 MB) intoSTVNet-Nano v3(2.18 MB) while retaining 100.0% of teacherTest mAP@50(0.6374vs.0.6373).

3. Transparent 7-Model Benchmark on Dense Unseen Field Scenes
All 7 models — including respected reference baselines YOLO26n and YOLO26s— were evaluated under identical COCO 101-point AP matching on 100 unseen agricultural test images (seed=42, 1024×1024, 4,010 GT objects). Our curated FirstDataset v3 (12,868 files, 12 verified CC BY 4.0 Roboflow Universe sources + 300 0-byte hard-negative background frames mined from Pexels #40310690) is openly published with full attribution.

Looking at the numbers objectively:
- Reference
YOLO26sandYOLO26nlead in overallmAP@50(0.6890),mAP@50-95(0.4119), and precision (74.7%). STVNet-Nano v3 ("Reka Nišava" KD)leads where dense field reliability and compactness matter most:2.18 MB(.stvmFP16) /1.38 MB(ONNX INT8) deploy footprint,0.5282 F1atconf=0.25,61.4%dense canopy recall (≥15 GT/image) and55.1%small-object recall,0 / 100zero-detection failures (100%frame coverage).STVNet-Small v3ONNX INT8 (1024×1024) reaches0.6545 mAP@50in just4.21 MB.

4. Multi-Hardware Reality: RTX A5000, x86 Servers, and Physical Raspberry Pi 5
- NVIDIA RTX A5000 GPU:
STVNet-Nano v3runs at54.54 FPSwhile drawing just17.62 Waverage GPU power and54.5 MBpeak PyTorch VRAM (Small v3:53.15 FPS). - x86_64 Servers & Desktops (ONNX Runtime):
52.64 FPSon 16-thread CPU and42.69 FPS(23.4 ms) on 4-thread edge CPU (640×640FP32). .stvm+ AES-256-GCM:128-byteheader zero-copymmapcontainer with optional authenticated weight encryption for commercial/OEM delivery.

To stress-test constrained edge headroom, we also trained STVNet-Nano v3("Reka Nišava") directly on a physical Raspberry Pi 5 CPU (ARM Cortex-A76, no GPU accelerator):
- 20-epoch on-device CPU training: Completed in
2.35 hoursunder0.86 GBpeak RAM(ActiveMemoryGovernor+ step-level resume). - On-device inference:
23.89 FPSONNX (416) and11.81 FPSlive720p.stvmvideo (100%frame detection coverage).


.stvm video inference telemetry.5. Practical Usage: Start in 3 Lines of Python or CLI
from huggingface_hub import hf_hub_download
from spaceteknopolivision.engine.vision_engine import VisionEngine
weights = hf_hub_download("denizzhansahin/SpaceTeknopoliVision", "weights/stvnet_nano_v3_kd.stvm")
engine = VisionEngine(weights, conf=0.25, device="auto") # CUDA / MPS / CPU
result = engine.predict("greenhouse_frame.jpg")
result.save("output.jpg")Or via the unified CLI:
stv predict --model weights/stvnet_nano_v3_kd.stvm --source greenhouse_frame.jpg --conf 0.25
stv train --data FirstDataset/data.yaml --model small_v3 --imgsz 1024 --epochs 300 --max-memory auto
stv export --weights weights/stvnet_nano_v3_kd.stvm --output nano_v3_640.onnx --format onnx --imgsz 640 --int8
6. Scientific Transparency, License, and Live Resources
Through v3 (“Reka Nišava”), Object Detection is our officially field-verified and benchmarked task. Instance segmentation, spatial robotic intelligence (SpatialSession, SLAM, Vision-RAG), temporal state caching (TFC/TSC), and the optional read-only MCP bridge are openly shared in the repository as Community Preview pending multi-site field validation.
SpaceTeknopoliVision is released under STV-PRAL v2: free for non-commercial personal learning and student projects with attribution; commercial deployments and external academic publications/theses require prior written permission from Denizhan Şahin (denizhan@linksphere.tr · mobilhaber2025@gmail.com).
Explore & Test Live
- Official Web Portal & 24 Trilingual Guides (EN · TR · SR):https://vision.linksphere.tr
- Multi-Hardware & Edge Deployment Hub:https://vision.linksphere.tr/edge
- Live Browser Demo (Gradio Space on ZeroGPU):https://huggingface.co/spaces/denizzhansahin/SpaceTeknopoliVision
- Unified Hugging Face Collection:https://huggingface.co/collections/denizzhansahin/spaceteknopolivision-6b0d317569a986c8d1e3f600
- 18 Pretrained STVNet Weights (
v2&v3):https://huggingface.co/denizzhansahin/SpaceTeknopoliVision - GitHub Repository (C++20 + PyTorch SDK):https://github.com/denizzhansahin/SpaceTeknopoliVision
Have questions about FusedISP SIMD, our Hybrid Neuro-Transformer layers, or training directly on a Raspberry Pi 5? Drop a comment below!