Files
DarkRoom/core/dr-face/examples/probe.rs
T
dtourolleandClaude Opus 5 b846b312b8
🐳 Android image / Build and push (push) Successful in 2s
Build and test / android-image (push) Successful in 2s
Build and test / Desktop (Linux) (push) Successful in 1h21m32s
Build and test / Layer separation (push) Successful in 37s
Traceability / Requirement traces (push) Successful in 25s
Build and test / Android (aarch64) (push) Failing after 33m58s
Run the formatter over the face branch before it reaches CI
The merge of the SCRFD/MobileFaceNet work brought 69 rustfmt diffs across
dr-catalog, dr-face and dr-ui with it, so `cargo fmt --all -- --check` fails
on master and the Desktop job stops at its Format step — before clippy, the
tests or the release build have run at all. That makes the whole desktop
half of CI blind: a real compile error behind this would look exactly the
same from the outside. There was nothing behind it, as it turns out — with
the formatting fixed, clippy, the test suite and the release build all pass.

Every .rs hunk is `cargo fmt --all` on the pinned 1.92.0 toolchain, not a
hand edit, but it is worth being precise about what that moved, because it
is more than whitespace. Besides reflowing signatures and call chains,
rustfmt reordered the `pub mod` and `pub use` items in dr-face/src/lib.rs so
the `#[cfg(feature = "inference")]` entries sort in place, added the trailing
semicolon inside `let ... else { return }` bodies in identity_ui.rs, wrapped
a bare closure body in braces in cluster.rs, adjusted trailing commas, and
dropped a stray blank line at the end of identity_ui.rs. All of it is
semantically inert; none of it changes behaviour.

docs/traceability.md rides along because it has to. The matrix records each
TRACES tag by line number, and reflowing develop.rs, lib.rs, faces.rs,
identity.rs and identity_ui.rs moved them — FR-CAT-8, FR-CAT-9, FR-CULL-10,
FR-DEV-3, FR-DEV-3a and FR-DEV-3c all shift by a line or two. The matrix was
verified up to date on d777f7f before this commit, so this is drift these
formatting changes introduced, not pre-existing staleness being swept up.
Leaving it for a follow-up commit would hand traceability-check.yml a
failure caused entirely by a whitespace change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 13:12:49 +02:00

59 lines
1.8 KiB
Rust

//! M1 (docs/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<String> = 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);
}
}