M13.36: face tracking trained model — MediaPipe Face Landmarker on a pure-Rust TFLite interpreter
- effectcraft-segment: a FaceModel interface (find a face in a region, follow it; a Topology maps the model's points to the tracker's landmarks and outline), a TensorFlow Lite reader and interpreter (float ops, float16 weights folded; matches ai-edge-litert to ~1e-6), and MediaPipe Face Landmarker (Google, Apache-2.0: BlazeFace + Face Mesh V2, 3.8 MB, pinned SHA-256). The registry gains a task and authors per model; installed weights get a NOTICE. - effectcraft-track: FaceTracker::new_with uses the model, falls back to the classical fitter when it finds no face; chin and jaw come from the outline either way so measurements agree. - Engine: roto_models becomes models (both tasks); face.models / face.model.* commands, Settings ▸ Face Tracking, `wait` on select/install/download for scripts; track.mask reports faceModel. - Credits: ATTRIBUTION.md lists the optional models and the Apache-2.0 specs the code follows. - Docs: README, ROADMAP (G7), gaps, parity (TRK-3 score unchanged pending G1), agents, preferences, architecture, segment README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4624c00308
commit
e43bf66775
@@ -102,6 +102,12 @@ fn read_entry<'a>(b: &'a [u8], e: &Entry) -> Result<std::borrow::Cow<'a, [u8]>>
|
||||
}
|
||||
}
|
||||
|
||||
/// The bytes of the archive entry `name` (model bundles are zip archives too).
|
||||
pub(crate) fn zip_file<'a>(b: &'a [u8], name: &str) -> Result<std::borrow::Cow<'a, [u8]>> {
|
||||
let entries = zip_entries(b)?;
|
||||
read_entry(b, entries.get(name).ok_or_else(|| format!("{name} is missing from the archive"))?)
|
||||
}
|
||||
|
||||
/// Pickle values (what state dicts use).
|
||||
#[derive(Clone, Debug)]
|
||||
enum Obj {
|
||||
@@ -341,7 +347,7 @@ fn to_f32(dtype: &str, bytes: &[u8]) -> Option<Vec<f32>> {
|
||||
}
|
||||
}
|
||||
|
||||
fn half_to_f32(h: u16) -> f32 {
|
||||
pub(crate) fn half_to_f32(h: u16) -> f32 {
|
||||
let (s, e, m) = ((h >> 15) as u32, ((h >> 10) & 0x1f) as u32, (h & 0x3ff) as u32);
|
||||
let bits = match (e, m) {
|
||||
(0, 0) => s << 31,
|
||||
|
||||
Reference in New Issue
Block a user