refactor(gui): set fixed input dimensions for face detection
This commit is contained in:
@@ -85,7 +85,6 @@ impl FaceDetectionBridge {
|
||||
// Load the image
|
||||
let img = image::open(&image_path)?;
|
||||
let img_rgb = img.to_rgb8();
|
||||
let (width, height) = img_rgb.dimensions();
|
||||
|
||||
// Convert to ndarray format
|
||||
let image_array = img_rgb.as_ndarray()?;
|
||||
@@ -94,8 +93,8 @@ impl FaceDetectionBridge {
|
||||
let config = FaceDetectionConfig::default()
|
||||
.with_threshold(threshold)
|
||||
.with_nms_threshold(nms_threshold)
|
||||
.with_input_width(width as usize)
|
||||
.with_input_height(height as usize);
|
||||
.with_input_width(1024)
|
||||
.with_input_height(1024);
|
||||
|
||||
// Create detector and detect faces
|
||||
let faces = match executor_type {
|
||||
@@ -186,14 +185,14 @@ impl FaceDetectionBridge {
|
||||
let config1 = FaceDetectionConfig::default()
|
||||
.with_threshold(threshold)
|
||||
.with_nms_threshold(nms_threshold)
|
||||
.with_input_width(img1.width() as usize)
|
||||
.with_input_height(img1.height() as usize);
|
||||
.with_input_width(1024)
|
||||
.with_input_height(1024);
|
||||
|
||||
let config2 = FaceDetectionConfig::default()
|
||||
.with_threshold(threshold)
|
||||
.with_nms_threshold(nms_threshold)
|
||||
.with_input_width(img2.width() as usize)
|
||||
.with_input_height(img2.height() as usize);
|
||||
.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 {
|
||||
|
||||
Reference in New Issue
Block a user