nn2
FreeTiny zero-dependency neural network inference engine in pure C with hand-written SIMD kernels (AVX-512 / AVX2 / NEON). Runs the FaceX face recognition stack on Apple Silicon, ARM SBCs and ESP32-P4. Apache 2.0.
About nn2
nn2 is a tiny zero-dependency neural network inference engine written in pure C, featuring hand-tuned SIMD kernels (AVX-512, AVX2, NEON). It is designed for real-time object detection using YOLO models and is part of the FaceX face recognition stack. The engine achieves up to 1.50x speedup over ONNX Runtime on Intel i5-11500, supports multiple platforms (Apple Silicon, ARM SBCs, ESP32-P4), and includes a production-ready NVR server with a web dashboard, REST API, motion-gated inference, Kalman tracking, SORT tracker, line-crossing counting, and zone intrusion detection. It is licensed under Apache 2.0 and has a tiny binary size of about 520KB.
Key Features
Pros & Cons
- Exceptional performance: up to 1.50x faster than ONNX Runtime
- Zero external dependencies – easy to build and deploy
- Extremely small binary (~520KB) suitable for resource-constrained devices
- Open-source under Apache 2.0 license
- Includes comprehensive NVR features (dashboard, API, tracking, counting)
- Supports multiple architectures (x86, ARM, RISC-V via ESP32-P4)
- Currently limited to YOLO architecture models (YOLOv8n demonstrated)
- Requires manual weight conversion from PyTorch using provided tools
- No GPU acceleration support – CPU-only inference
- Documentation is sparse beyond the README