refactor(flags): remove dead face_confirm, consolidate unified_pose, cap OpenCV threads#99
Merged
Merged
Conversation
…ose, cap OpenCV threads Flip-switch cleanup + a real CPU-oversubscription fix: - Remove the per-camera "Confirm with face recognition" toggle (tracking.face_confirm). It never gated engine behaviour — face is controlled by the global face_recognition module switch — so it only persisted and displayed itself. Telemetry "configured" now reflects the actual feature flag. Old configs ignore the stale key (no extra=forbid). - Consolidate the AUTOPTZ_UNIFIED_POSE env flag into a single resolver (autoptz.engine.runtime.flags.env_unified_pose); the inference pool and worker stacks share one source of truth instead of two duplicate readers. - Cap OpenCV's thread pool (resize/letterbox + per-frame optical flow), which was uncapped and fanned across all cores (the ORT sessions were already capped by the supervisor). flags.apply_opencv_thread_cap is applied in the supervisor and re-applied in the process-per-camera child. macOS-GCD-aware: that backend ignores a positive count, so the cap forces single-threaded only under heavy multi-camera load; TBB/OpenMP honour it. Adds tests/test_flags.py. Full suite green (1033), ruff clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flip-switch architecture cleanup + a real CPU-oversubscription fix.
Changes
face_confirmknob — the per-camera "Confirm with face recognition" toggle never gated engine behaviour (face is controlled by the globalface_recognitionmodule switch). Removed the config field, UI checkbox, and telemetry use; telemetryconfigurednow reflects the actual feature flag. Old configs ignore the stale key (noextra=forbid).unified_pose— single resolverautoptz.engine.runtime.flags.env_unified_pose; the inference pool and worker stacks share one source of truth instead of two duplicate env readers.cv2.setNumThreadswas never called, so OpenCV (resize/letterbox + the per-frame ego optical-flow) fanned across all cores while the ORT sessions were already capped. Newflags.apply_opencv_thread_capcaps it to the same per-camera budget, applied in the supervisor and re-applied in the process-per-camera child. macOS-GCD-aware: that backend ignores a positive count (only0works), so the cap forces single-threaded only under heavy multi-camera load; TBB/OpenMP backends honour the exact count.Tests
tests/test_flags.py(18 cases; OpenCV-backend-portable contract).Notes
🤖 Generated with Claude Code