feat(compare): add face comparison functionality with cosine similarity
Some checks failed
build / checks-matrix (push) Successful in 19m23s
build / codecov (push) Failing after 19m18s
docs / docs (push) Failing after 28m50s
build / checks-build (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-08-21 17:34:07 +05:30
parent f8122892e0
commit bfa389b497
15 changed files with 1188 additions and 107 deletions

View File

@@ -64,10 +64,7 @@ impl EmbeddingGenerator {
}
pub fn run_models(&self, face: ArrayView4<u8>) -> Result<Array2<f32>> {
let tensor = face
// .permuted_axes((0, 3, 1, 2))
.as_standard_layout()
.mapv(|x| x as f32);
let tensor = crate::faceembed::preprocessing::preprocess(face);
let shape: [usize; 4] = tensor.dim().into();
let shape = shape.map(|f| f as i32);
let output = self