feat: Added threshold for scores and nms

This commit is contained in:
uttarayan21
2025-08-05 13:39:15 +05:30
parent bcb7c94390
commit 561fb2a924
4 changed files with 47 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
mod cli;
mod errors;
use detector::facedet::retinaface::FaceDetectionConfig;
use errors::*;
use ndarray_image::*;
const RETINAFACE_MODEL: &[u8] = include_bytes!("../models/retinaface.mnn");
@@ -29,11 +30,11 @@ pub fn main() -> Result<()> {
.attach_printable("Failed to detect faces")?;
// output.print(20);
let aabbs = output
.postprocess(Default::default())
.postprocess(FaceDetectionConfig::default().with_threshold(detect.threshold))
.change_context(errors::Error)
.attach_printable("Failed to attach context")?;
for bbox in aabbs {
println!("Detected face: {:?}", bbox);
tracing::info!("Detected face: {:?}", bbox);
use bounding_box::draw::*;
let bbox = bbox
.denormalize(nalgebra::SVector::<f32, 2>::new(