From f495b47a9611a4058746212ef577e367ac948ace Mon Sep 17 00:00:00 2001 From: ziesorx Date: Mon, 20 Oct 2025 18:04:23 +0700 Subject: [PATCH] fix: increase tracking thread and lower tracking min confidence --- core/tracking/integration.py | 3 ++- core/tracking/validator.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/tracking/integration.py b/core/tracking/integration.py index 1e3fc97..6ff2ee7 100644 --- a/core/tracking/integration.py +++ b/core/tracking/integration.py @@ -70,7 +70,8 @@ class TrackingPipelineIntegration: self.abandonment_timeout = 3.0 # seconds to wait before declaring car abandoned # Thread pool for pipeline execution - self.executor = ThreadPoolExecutor(max_workers=2) + # Increased to 8 workers to handle 8 concurrent cameras without queuing + self.executor = ThreadPoolExecutor(max_workers=8) # Min bbox filtering configuration # TODO: Make this configurable via pipeline.json in the future diff --git a/core/tracking/validator.py b/core/tracking/validator.py index d86a3f6..0c1dca4 100644 --- a/core/tracking/validator.py +++ b/core/tracking/validator.py @@ -56,10 +56,15 @@ class StableCarValidator: self.config = config or {} # Validation thresholds - self.min_stable_duration = self.config.get('min_stable_duration', 3.0) # seconds - self.min_stable_frames = self.config.get('min_stable_frames', 10) + # Optimized for 6 FPS RTSP source with 8 concurrent cameras on GPU + # GPU contention reduces effective FPS to ~3-5 per camera + # Reduced from 3.0s to 1.5s to achieve ~2.75s total validation time (was ~4.25s) + self.min_stable_duration = self.config.get('min_stable_duration', 1.5) # seconds + # Reduced from 10 to 5 to align with tracker requirement and reduce validation time + self.min_stable_frames = self.config.get('min_stable_frames', 5) self.position_variance_threshold = self.config.get('position_variance_threshold', 25.0) # pixels - self.min_confidence = self.config.get('min_confidence', 0.7) + # Reduced from 0.7 to 0.45 to be more permissive under GPU load + self.min_confidence = self.config.get('min_confidence', 0.45) self.velocity_threshold = self.config.get('velocity_threshold', 5.0) # pixels/frame self.entering_zone_ratio = self.config.get('entering_zone_ratio', 0.3) # 30% of frame self.leaving_zone_ratio = self.config.get('leaving_zone_ratio', 0.3)