Expand description
deepvision — the CNN forward-pass primitives, the third Phase-8 line.
The building blocks that run a convolutional network over space imagery: conv2d, relu,
max_pool2d, dense and softmax. Pure Rust, no_std, libm only — no ML framework,
so it links anywhere (embedded / offline) and adds no heavy dependency tree. Tensors are
caller-provided row-major f64 slices in HWC layout (height, width, channel); a caller sizes
the outputs with conv_out_dim / pool_out_dim.
This is the inference kernel. Loading trained models exported to ONNX is the opt-in onnx
module (--features onnx, pure-Rust tract); it pulls a std-only dependency and stays out of
the default no_std build.
Re-exports§
pub use nn::BatchNormParams;pub use nn::Conv2d;pub use nn::ConvTranspose2d;pub use nn::add;pub use nn::batch_norm;pub use nn::concat_channels;pub use nn::conv_out_dim;pub use nn::conv_transpose2d;pub use nn::conv2d;pub use nn::dense;pub use nn::global_avg_pool;pub use nn::max_pool2d;pub use nn::pad2d;pub use nn::pool_out_dim;pub use nn::relu;pub use nn::sigmoid;pub use nn::softmax;pub use model::Layer;pub use model::Sequential;pub use model::weights_from_le_bytes;pub use graph::Graph;pub use graph::Node;pub use graph::Op;pub use detect::BBox;pub use detect::decode_box;pub use detect::generate_anchors;pub use detect::nms;pub use onnx::OnnxError;pub use onnx::OnnxModel;pub use onnx::threshold_mask;
Modules§
- detect
- Object-detection post-processing — the head that turns dense per-anchor predictions into a short list of boxes: anchor generation, box decoding, IoU, and non-maximum suppression.
- graph
- A
Graphmodel — a directed acyclic graph ofOpnodes, the generalisation of the linearcrate::model::Sequentialto networks with skip connections: residual adds (ResNet) and channel concatenations (U-Net). - model
- A
Sequentialmodel — an ordered stack ofLayers run end to end, with the tensor shape and scratch buffers managed for you, plus a little-endian weight-blob loader. - nn
- CNN forward-pass primitives on caller-provided row-major
f64tensors (HWC layout). - onnx
- Load and run trained ONNX models through
tract— the opt-inonnxfeature, the bridge from hand-authoredcrate::nngraphs to networks trained in PyTorch/TensorFlow and exported to ONNX.tractis pure Rust (no C/C++ runtime), but needsstd, so the whole path is feature-gated and never enters the defaultno_stdbuild.