fix: correct face detection threshold defaults
- Changed min_confidence from 50.0 to 0.5 (Vision uses 0.0-1.0 range) - Changed min_size from 32 to 1 (was filtering out all small faces) - Changed min_capture_quality from 25.0 to 0.25 - Fixes issue where all videos showed 0 faces detected Root cause: admin_config.rs used wrong defaults (50.0/32) instead of config.rs constants (0.5/1), causing Vision framework to filter out ALL faces because confidence threshold exceeded valid range. Verified: IMG_9449 now correctly detects 191 faces (was 0).
This commit is contained in:
@@ -2,8 +2,6 @@ use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::core::config::{FACE_FILTER_CONFIDENCE_PCT_DEFAULT, FACE_MIN_SIZE_DEFAULT};
|
||||
|
||||
/// Version of the file profile schema.
|
||||
const PROFILE_VERSION: &str = "1.0";
|
||||
|
||||
@@ -17,16 +15,37 @@ pub struct FaceFilterSettings {
|
||||
pub min_size: i32,
|
||||
#[serde(default)]
|
||||
pub min_capture_quality: f64,
|
||||
|
||||
// Single Frame Trace 配置
|
||||
#[serde(default = "default_true")]
|
||||
pub single_frame_trace_vlm_enabled: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub single_frame_trace_group_enabled: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub single_frame_trace_unassigned_enabled: bool,
|
||||
|
||||
// Single Trace Group 配置
|
||||
#[serde(default = "default_true")]
|
||||
pub single_trace_group_filter_enabled: bool,
|
||||
}
|
||||
|
||||
fn default_true() -> bool { true }
|
||||
|
||||
impl FaceFilterSettings {
|
||||
/// Mirrors Apple Vision default detection thresholds (0.5 / 1px).
|
||||
/// Filter later for display; detect everything first.
|
||||
/// Load defaults from admin config (processor_config.face).
|
||||
/// Falls back to hardcoded values if admin config unavailable.
|
||||
pub fn defaults() -> Self {
|
||||
let (min_confidence, min_size, min_capture_quality) =
|
||||
crate::core::admin_config::get_face_filter_defaults();
|
||||
|
||||
Self {
|
||||
min_confidence: FACE_FILTER_CONFIDENCE_PCT_DEFAULT,
|
||||
min_size: FACE_MIN_SIZE_DEFAULT,
|
||||
min_capture_quality: 0.0,
|
||||
min_confidence,
|
||||
min_size,
|
||||
min_capture_quality,
|
||||
single_frame_trace_vlm_enabled: true,
|
||||
single_frame_trace_group_enabled: true,
|
||||
single_frame_trace_unassigned_enabled: true,
|
||||
single_trace_group_filter_enabled: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user