fix: A lot of fixes relating to bounding-boxes

This commit is contained in:
uttarayan21
2025-08-05 14:39:16 +05:30
parent 561fb2a924
commit 42ac210bba
4 changed files with 104 additions and 42 deletions

View File

@@ -29,11 +29,11 @@ pub fn main() -> Result<()> {
.change_context(errors::Error)
.attach_printable("Failed to detect faces")?;
// output.print(20);
let aabbs = output
let faces = output
.postprocess(FaceDetectionConfig::default().with_threshold(detect.threshold))
.change_context(errors::Error)
.attach_printable("Failed to attach context")?;
for bbox in aabbs {
for bbox in faces.bbox {
tracing::info!("Detected face: {:?}", bbox);
use bounding_box::draw::*;
let bbox = bbox
@@ -41,7 +41,7 @@ pub fn main() -> Result<()> {
array.shape()[1] as f32,
array.shape()[0] as f32,
))
.cast()
.try_cast()
.ok_or(errors::Error)
.attach_printable("Failed to cast f32 to usize")?;
array.draw(bbox, color::palette::css::GREEN_YELLOW.to_rgba8(), 10);