Files
continuum-ai-worker/src/inference/mod.rs
T
octoturge db5adc9324 Simplify boilerplate for learning: stub inference and Postgres write
Removed ort/ndarray/image (ONNX Runtime inference) and sqlx (Postgres audit
write). inference::detect() and the Postgres half of reporter::report() are
now stubs with a comment for what real code goes there. Redis Streams
XREADGROUP loop and the Redis pub/sub alert stay real.

Verified with a clean cargo check --all-targets (0 warnings).
2026-08-28 18:23:55 +00:00

20 lines
763 B
Rust

use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct Detection {
pub label: String,
pub confidence: f32,
}
/// Stand-in for real ONNX Runtime inference (the `ort` crate, using a model
/// trained on failure images). Always reports one fixed "failure" so the
/// rest of the pipeline — reporting, acking the stream entry — has
/// something to do and can be tested without a real model file.
///
/// Swap this out once you're comfortable with the pipeline around it:
/// decode `frame_bytes` with the `image` crate, run it through an `ort`
/// session, and turn the model's output into real `Detection`s.
pub fn detect(_frame_bytes: &[u8]) -> Vec<Detection> {
vec![Detection { label: "spaghetti".to_string(), confidence: 0.91 }]
}