Skip to main content

Crate chess_corners_ml

Crate chess_corners_ml 

Source
Expand description

ONNX-backed ML refiner for ChESS corner candidates.

This crate provides MlModel, a thin wrapper around a tract-onnx runtime that predicts subpixel (dx, dy) offsets for each corner candidate from a normalized intensity patch.

§Intended use

This crate is not meant to be used directly. It is consumed by the chess-corners facade crate when the ml-refiner feature is enabled. With the feature on, set the active ChESS refiner to ChessRefiner::Ml and call Detector::detect to route through the ML refiner.

§Embedded model

When the optional embed-model feature is enabled, the ONNX model and its external data file are compiled into the binary via include_bytes! and extracted to a temporary directory on first use. The extraction is thread-safe and idempotent (write-then-rename with byte-match skip).

§Performance note

ML refinement is significantly slower than the geometric refiners (~24 ms vs <1 ms for 77 corners on a 640×480 image). Use it only when maximum subpixel accuracy is required and throughput allows.

Structs§

MlModel
Loaded and optimised ONNX model for corner refinement.

Enums§

ModelSource
Specifies where MlModel::load should read the ONNX model from.