insight-face-rs 1.4.0

Face detection and recognition library using ONNX Runtime (Rust)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
#[serde(from = "[[f32; 2]; 5]", into = "[[f32; 2]; 5]")]
pub struct FaceLandmarks(pub [[f32; 2]; 5]);

impl From<[[f32; 2]; 5]> for FaceLandmarks {
    fn from(value: [[f32; 2]; 5]) -> Self {
        Self(value)
    }
}

impl From<FaceLandmarks> for [[f32; 2]; 5] {
    fn from(value: FaceLandmarks) -> Self {
        value.0
    }
}