feat(compare): add face comparison functionality with cosine similarity
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user