Skip to main content

vww

VWW (Visual Wake Words) — Lightweight convolutional neural network library for human detection. Based on MobileNet-like depthwise separable convolution architecture, INT8 quantized, pure C99 implementation, zero external dependencies.

API

#include <vww.h>

int vision_vww(struct vision_t * v);
ParameterDescription
vInput image (grayscale or RGB format, resolution must be >= 96x96), internally center-cropped (preserving aspect ratio, shorter side aligned to 96 pixels) then resized to 96x96. If the input resolution is < 96x96, use vision_resize to upscale first
Return valueHuman confidence percentage (0-100)

Shell Command

The vww command is used to detect humans in an image.

vww <image>
# Detect humans in an image
vww person.jpg
# Output: person: 87%

Network Structure

MobileNet-like depthwise separable convolutional network, 12 layers total.

LayerTypeInputOutputKernelStride
L0CONV2D96x96x348x48x83x32x2
L1DWCONV2D48x48x848x48x83x31x1
L2CONV2D48x48x848x48x161x11x1
L3DWCONV2D48x48x1624x24x163x32x2
L4CONV2D24x24x1624x24x321x11x1
L5DWCONV2D24x24x3224x24x323x31x1
L6CONV2D24x24x3224x24x321x11x1
L7DWCONV2D24x24x3212x12x323x32x2
L8CONV2D12x12x3212x12x641x11x1
L9DWCONV2D12x12x6412x12x643x31x1
L10CONV2D12x12x6412x12x641x11x1
L11DWCONV2D12x12x646x6x643x32x2

Output goes through global average pooling + fully connected layer for classification.

Quantization

  • Weights: INT8
  • Biases: INT32
  • Scale factors: INT32
  • Activation function: ReLU

All weights and biases are embedded in the code at compile time, no external model file required.