Decouple display and recording/inference FPS#80
Draft
C-Achard wants to merge 5 commits into
Draft
Conversation
Refactor _on_frame_captured to minimize time spent under _frame_lock and improve timing granularity. Introduces a frame_data local, renames timing labels (e.g. Multi.apply_transforms, Multi.store_latest, Multi.build_ordered, Multi.construct_frame_data), and moves frame_data construction inside measured blocks. The frame_ready emit is now performed outside the lock and guarded by a None check to avoid holding the lock during signal emission. Also small whitespace and cleanup changes.
Introduce a separate, throttled UI/display path for multi-camera frames. Add GUI_MAX_DISPLAY_FPS config and a new display_ready signal that is emitted at most at that rate, while frame_ready remains full-rate for recording/inference. Implement _should_emit_display_ready, wire the MultiCameraController to emit both signals, and reset throttling state when starting. Update the main window to handle processing and display paths via _on_multi_frame_processing_ready and _on_multi_frame_display_ready, and adjust tests accordingly. Also add GUI/debug timing config keys and a temporary timing-only early path in SingleCameraWorker (marked as FIXME).
Add helpers and telemetry to better read and debug GenTL/GenICam cameras. - New debug helper _debug_frame_rate_nodes to log many common frame-rate/exposure/throughput nodes. - Added robust node accessors: _node_value, _node_float, _node_str to safely read various GenICam node types and try multiple node names. - Enhance frame-rate configuration to log before/after values when enabling rate control and when setting AcquisitionFrameRate/AcquisitionFrameRateAbs; record any accepted frame-rate as _actual_fps. - After starting acquisition, attempt to read telemetry and run FPS debug logging; warn (but continue) if telemetry read fails. - Improve _read_telemetry to prefer resulting frame-rate nodes over requested ones, and to populate actual_fps, actual_exposure, actual_gain and other useful properties (pixel format, throughput, resolution, etc.) into the settings namespace for GUI/debugging. These changes make frame-rate/exposure behavior more observable and more tolerant across different camera implementations.
Contributor
There was a problem hiding this comment.
Pull request overview
Decouples high-rate camera frame processing (recording/inference) from GUI display updates by introducing a separate, throttled display_ready signal capped at GUI_MAX_DISPLAY_FPS, and improves GenTL FPS configuration/telemetry with new node-reading helpers and debug logging.
Changes:
- Add
display_readysignal and_should_emit_display_ready()throttling inMultiCameraController; restructure_on_frame_capturedtiming sections. - Split
_on_multi_frame_readyinto_on_multi_frame_processing_ready(recording/inference) and_on_multi_frame_display_ready(GUI), and addGUI_MAX_DISPLAY_FPSplus debug-timing flags inconfig.py. - Improve GenTL backend: add
_node_value/_node_float/_node_strhelpers,_debug_frame_rate_nodes, expanded telemetry (resulting vs requested FPS, exposure, gain, throughput, pixel format), and richer FPS configuration logging.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dlclivegui/config.py | Adds GUI_MAX_DISPLAY_FPS and debug timing flags. |
| dlclivegui/services/multi_camera_controller.py | Adds throttled display_ready signal and refactors frame handling/timing. |
| dlclivegui/gui/main_window.py | Splits processing/display handlers and rewires multi-camera signal connections. |
| dlclivegui/cameras/backends/gentl_backend.py | Adds node-reading helpers, FPS debug logging, and broader telemetry readback. |
| tests/gui/test_pose_overlay.py | Updates test to use renamed _on_multi_frame_processing_ready handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix signal hookup and disable main-window timing flag. Replace the second connection of multi_camera_controller.frame_ready to _on_multi_frame_display_ready with multi_camera_controller.display_ready to separate processing-ready and display-ready events. Also comment out MAIN_WINDOW_DO_LOG_TIMING in config.py to disable main-window timing logging.
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.
Motivation
This pull request introduces several improvements to multi-camera handling, frame rate configuration, and debugging/telemetry in the codebase.
The main changes include
Automated summary
Multi-camera frame handling and GUI update throttling:
frame_readysignal (used for recording and inference) from the newdisplay_readysignal (throttled toGUI_MAX_DISPLAY_FPSfor efficient GUI updates) inMultiCameraController, with corresponding handler changes inmain_window.py(_on_multi_frame_processing_readyand_on_multi_frame_display_ready). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]GUI_MAX_DISPLAY_FPSglobal setting and related debug flags inconfig.py.main_window.pyto reflect the separation of processing and display paths. [1] [2] [3]Camera frame rate configuration and telemetry improvements:
gentl_backend.pyto log before/after states, use more robust node selection, and set the actual FPS based on accepted values.Debugging and utility enhancements:
_debug_frame_rate_nodesfor detailed logging of relevant GenICam node values, aiding in debugging frame rate issues. [1] [2]_node_value,_node_float, and_node_strfor robust, best-effort extraction of node values, reducing boilerplate and error handling throughout the code.These changes collectively make the system more robust for high-performance multi-camera setups and improve the ability to debug and monitor camera settings and telemetry.