feat: Added facenet
This commit is contained in:
@@ -274,7 +274,7 @@ impl FaceDetection {
|
||||
|
||||
pub fn detect_faces(
|
||||
&self,
|
||||
image: ndarray::Array3<u8>,
|
||||
image: ndarray::ArrayView3<u8>,
|
||||
config: FaceDetectionConfig,
|
||||
) -> Result<FaceDetectionOutput> {
|
||||
let (height, width, _channels) = image.dim();
|
||||
@@ -299,7 +299,8 @@ impl FaceDetection {
|
||||
.map(|((b, s), l)| (b, s, l))
|
||||
.multiunzip();
|
||||
|
||||
let keep_indices = nms(&boxes, &scores, config.threshold, config.nms_threshold);
|
||||
let keep_indices =
|
||||
nms(&boxes, &scores, config.threshold, config.nms_threshold).change_context(Error)?;
|
||||
|
||||
let bboxes = boxes
|
||||
.into_iter()
|
||||
@@ -327,7 +328,7 @@ impl FaceDetection {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn run_models(&self, image: ndarray::Array3<u8>) -> Result<FaceDetectionModelOutput> {
|
||||
pub fn run_models(&self, image: ndarray::ArrayView3<u8>) -> Result<FaceDetectionModelOutput> {
|
||||
#[rustfmt::skip]
|
||||
use ::tap::*;
|
||||
let output = self
|
||||
|
||||
Reference in New Issue
Block a user