//! M1 (docs/dev/faces.md §12) — will tract load these graphs at all? //! //! The one measurement everything else in the face subsystem is conditional //! on. `det_500m.onnx` has a dynamic H/W input, which is exactly what tract //! failed on for YOLO26n-seg, so a plain "no" here is the expected outcome and //! the interesting part is the error it gives. //! //! cargo run -p dr-face --features inference --example probe -- MODEL... fn main() { env_logger::init(); let paths: Vec = std::env::args().skip(1).collect(); if paths.is_empty() { eprintln!("usage: probe MODEL.onnx [MODEL.onnx ...]"); std::process::exit(2); } let mut failures = 0; for path in &paths { println!("\n=== {path} ==="); let bytes = match std::fs::read(path) { Ok(b) => b, Err(e) => { println!(" UNREADABLE: {e}"); failures += 1; continue; } }; println!(" {} bytes", bytes.len()); dr_face::install_backend_for_probe(); let session = ort::session::Session::builder().and_then(|mut b| b.commit_from_memory(&bytes)); match session { Err(e) => { println!(" LOAD FAILED: {e}"); failures += 1; } Ok(s) => { println!(" LOADED"); for i in s.inputs() { println!(" in {:<24} {:?}", i.name(), i.dtype().tensor_shape()); } for o in s.outputs() { println!(" out {:<24} {:?}", o.name(), o.dtype().tensor_shape()); } } } } println!("\n{} of {} failed", failures, paths.len()); if failures > 0 { std::process::exit(1); } }