refactor(gui): remove commented-out code in face detection function
This commit is contained in:
@@ -181,27 +181,6 @@ impl FaceDetectionBridge {
|
||||
nms_threshold: f32,
|
||||
executor_type: ExecutorType,
|
||||
) -> Result<(usize, usize, f32), Box<dyn std::error::Error + Send + Sync>> {
|
||||
// Load both images
|
||||
// let img1 = image::open(&image1_path)?.to_rgb8();
|
||||
// let img2 = image::open(&image2_path)?.to_rgb8();
|
||||
|
||||
// Convert to ndarray format
|
||||
// let image1_array = img1.as_ndarray()?;
|
||||
// let image2_array = img2.as_ndarray()?;
|
||||
|
||||
// Create detection configuration
|
||||
let config1 = FaceDetectionConfig::default()
|
||||
.with_threshold(threshold)
|
||||
.with_nms_threshold(nms_threshold)
|
||||
.with_input_width(1024)
|
||||
.with_input_height(1024);
|
||||
|
||||
let config2 = FaceDetectionConfig::default()
|
||||
.with_threshold(threshold)
|
||||
.with_nms_threshold(nms_threshold)
|
||||
.with_input_width(1024)
|
||||
.with_input_height(1024);
|
||||
|
||||
// Create detector and embedder, detect faces and generate embeddings
|
||||
let (faces1, faces2, best_similarity) = match executor_type {
|
||||
ExecutorType::MnnCpu | ExecutorType::MnnMetal | ExecutorType::MnnCoreML => {
|
||||
@@ -303,7 +282,6 @@ where
|
||||
.change_context(Error)
|
||||
.attach_printable(image.to_string_lossy().to_string())?;
|
||||
let image = image.into_rgb8();
|
||||
// let (image_width, image_height) = image.dimensions();
|
||||
let mut array = image
|
||||
.into_ndarray()
|
||||
.change_context(errors::Error)
|
||||
@@ -317,7 +295,6 @@ where
|
||||
)
|
||||
.change_context(errors::Error)
|
||||
.attach_printable("Failed to detect faces")?;
|
||||
dbg!(&output);
|
||||
|
||||
for bbox in &output.bbox {
|
||||
tracing::info!("Detected face: {:?}", bbox);
|
||||
|
||||
Reference in New Issue
Block a user