Open
Conversation
…era-functionality
…camera-functionality Rework layout and camera handling controls
…' into artur/test_update
…r integration - Implemented `get_device_count` method in `GenTLCameraBackend` to retrieve the number of GenTL devices detected. - Added `max_devices` configuration option in `CameraSettings` to limit device probing. - Introduced `BoundingBoxSettings` for bounding box visualization, integrated into the main GUI. - Enhanced `DLCLiveProcessor` to accept a processor instance during configuration. - Updated GUI to support processor selection and auto-recording based on processor commands. - Refactored camera properties handling and removed deprecated advanced properties editor. - Improved error handling and logging for processor connections and recording states.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… options to config
Switch DLCProcessorSettings.model_type default from a raw string to the Engine enum (Engine.PYTORCH) and change DLCLiveProcessor.get_model_backend to return an Engine instead of a string for stronger typing. Update the GUI to validate empty model path input, reuse the resolved model backend (model_bknd) when building settings, improve the backend-detection error message, and allow selecting any file/directory in the model file dialog (adjusted name filter label for TensorFlow model directories). Also fix a relative import in dlclivegui.temp.__init__.py. Note: this changes the get_model_backend return type (callers expecting a string must use .value if needed).
Adapt tests to recent refactors and improve CI reliability: - tests/gui/test_ascii_art.py: use LOGO_ALPHA instead of ASCII_IMAGE_PATH, switch color arg from "always" to "auto", and relax the non-TTY assertion to check for the description substring. - tests/gui/test_main.py: make test_start_inference_emits_pose use tmp_path to create a dummy_model.pt file and set the model path to that file so the existence check passes. - tox.ini: set QT_OPENGL=software to reduce OpenGL/CI flakiness, and comment out the [testenv:lint] section (also remove lint from the py312 env mapping). These changes fix tests broken by the logo variable rename and improve test stability in CI environments.
Stop importing and exporting GUI and multi-camera controller symbols at package level to avoid import-time side effects. Removed imports of CameraConfigDialog, DLCLiveMainWindow, MultiCameraController and MultiFrameData from dlclivegui.__init__ and removed those names from __all__. The top-level export list keeps "main" (callers should import GUI/controller types from their modules when needed).
Install Qt/OpenGL runtime dependencies on Ubuntu CI runners (libegl1, libgl1, libopengl0, libxkbcommon-x11-0, libxcb-cursor0) so tests that require OpenGL/Qt can run in the workflow. Also restrict the Codecov upload step to push events on refs/heads/main to avoid uploading coverage for other event types or branches.
Introduce explicit scan state and tidy worker APIs for camera discovery. - Add CameraScanState enum and use it as single source of truth in CameraConfigDialog (_scan_state). - Replace ad-hoc worker checks with _set_scan_state, _finish_scan and _cleanup_scan_worker to manage UI overlays, progress/cancel controls and stability guarantees. - Add request_scan_cancel() to request interruption and handle canceled/result flows; DetectCamerasWorker now emits result (even empty) and canceled when interrupted. - Simplify QThread usage: remove custom finished signals, add typing annotations and clearer run() signatures in loaders; adjust worker signals (canceled) and small API refinements (request_cancel return types). - Update UI hookup (ui_blocks) to call request_scan_cancel instead of private handler. - Update unit and e2e tests to follow new scan lifecycle (wait for scan_started/scan_finished, helper _run_scan_and_wait, and scan state assertions). Files changed: camera_config_dialog.py, loaders.py, ui_blocks.py and related tests to match the new scan lifecycle and worker behaviour.
Allow Codecov uploads for pushes and pull requests targeting main by loosening the workflow condition. Export the package's main entry (from .main import main) in dlclivegui.__init__ so the CLI/function is exposed. Add tox and tox-gh-actions to the test extras in pyproject.toml. Tidy tox.ini by adding a comment that linting is handled by pre-commit/format workflow and removing an optional tox-gh-actions helper section.
Coerce DLCProcessorSettings.model_type to a lowercase string (accepting Enum or string inputs) and validate allowed backends (pytorch, tensorflow). Update UI to handle TensorFlow .pb models by using the parent directory for DLCLive, restrict file dialog to existing files, add existence checks and backend detection when selecting a model. Improve ModelPathStore: robust path normalization, separate helpers for existing file/dir checks, smarter save/load/resolve logic, and better start-dir/suggest-file heuristics. Minor cleanup: remove duplicate import and clarify a TF model detection comment in engine.
Update tests in tests/utils/test_settings_store.py to exercise ModelPathStore normalization more robustly: use tmp_path to create real directories and files, assert _norm_existing_dir and _norm_existing_path return existing absolute paths (and that they are dir/file respectively), and handle None via _norm_existing_* helpers. Also adjust suggest_start_dir test to make cwd invalid by monkeypatching Path.cwd so the fallback to home is exercised. Removed the previous unreliable expanduser assertion.
Introduce a concurrency block to the testing CI workflow so runs for the same PR are grouped and previous in-progress jobs are cancelled when a new update is pushed. The group is keyed by workflow and pull request number (ci-${{ github.workflow }}-pr-${{ github.event.pull_request.number }}) to avoid redundant CI runs and save resources.
Introduce Engine helpers (is_pytorch_model_path, is_tensorflow_model_dir_path) and centralize model-file/TF-dir detection. Replace the old is_model_file usage with these helpers across settings_store and main_window, fixing a bug in suffix checking and ensuring .pb TensorFlow models are validated via their parent directory. Remove legacy is_model_file from utils. Also update camera UI to expect dlg.request_scan_cancel instead of _on_scan_cancel, refine scan-cancel test synchronization, and add/adjust unit tests to cover the new Engine detection logic.
Add sender() checks and debug logs to scan-related handlers so signals from old/stale scan workers are ignored. Update _is_scan_running to also consider the worker's isRunning() state. Only call _finish_scan("cancel") when there is no active worker to avoid prematurely finishing cancellation. These changes reduce race conditions when restarting/canceling camera scans and ensure UI reflects the current worker's state.
Update tests/utils/test_utils.py to import Engine from dlclivegui.temp instead of dlclivegui.temp.engine. Aligns the test import with the package re-export or module relocation so tests reference the correct top-level import.
Ensure model_check_path is set for non-.pb selections before calling DLCLiveProcessor.get_model_backend. .pb files still use the parent directory (TensorFlow expectation); other file types now pass the file path itself to avoid using an undefined or incorrect path.
Introduce a ModelType Literal type ("pytorch" | "tensorflow") and change DLCProcessorSettings.model_type from a plain str to this constrained type, keeping the default as "pytorch". This ensures pydantic validation enforces allowed model backends.
Set a static version (2.0.0rc1) in pyproject.toml and remove the dynamic setuptools configuration that read dlclivegui.__version__. Also remove the placeholder __version__ from dlclivegui/__init__.py so version metadata is centralized in pyproject.toml.
Introduce a cti_files_source marker (auto/user) and wiring to track whether CTI file lists were user-specified or auto-discovered. Treat legacy top-level properties.cti_file(s) as strict user overrides; treat properties.gentl.cti_file(s) as either an auto-cache (falls back to discovery if stale) or a user override depending on the marker. Persist the resolved source back into the namespace when resolving CTIs, and update harvester-selection/rebind logic to fall back to discovery when auto-cached CTIs are stale while still raising for strict user overrides. Also add a small import and internal field (_cti_files_source_used) to track the chosen source, plus logging when falling back from a stale auto-cache.
Add preflight checks, pattern validation and safer globbing for GenTL (.cti) discovery and loading. Renamed default CTI pattern constant to _LEGACY_DEFAULT_CTI_PATTERNS (Windows-only comment) and imported Path. Introduced _cti_preflight to detect missing/locked/permissioned files before Harvester.add_file and applied it where CTIs are loaded (skipping and logging problematic entries). Harden gentl_discovery with: redact-able diagnostics.summarize, _validate_glob_pattern, bounded _glob_limited, static-prefix checks, allowed-roots option and new discover_cti_files params (allow_globs, root_globs_allowed, max_glob_hits_per_pattern) to limit expensive scans. Also adjusted Harvester.update failure handling to treat update errors as discovery failures (return empty loaded list) and improved logging messages for discovery/load failures.
Introduce a single _expand_user_and_env() helper to consistently expand environment variables and '~', and use it across path normalization and glob validation. Update _normalize_path() to rely on the helper and Path handling, switch file existence checks to use a Path object, and add _dedup_key() to normalize deduplication on case-insensitive filesystems (Windows). Replace scattered os.path.expandvars/os.path.expanduser calls with the new helper for more predictable cross-platform behavior.
Adjust Harvester.update() error log string concatenation in gentl_backend.py to ensure proper spaces between message parts. Also remove an extraneous comment line from the gentl backend test to clean up test output.
Upgrade Gentl backend cti discovery
Pre-release cleanup for PySide6 GUI
Update dlclive requirement & add deploy workflow
Update the testing CI workflow to pass the CODECOV_TOKEN (secrets.CODECOV_TOKEN) to the Codecov action and set fail_ci_if_error to false so a failed upload won't break CI. Also add an inline note on the step name indicating the upload may need to be disabled if the token isn't configured.
Update .github/workflows/python-package.yml to trigger the pull_request workflow for branches [main, master] instead of [main, public]. This ensures PRs targeting the master branch will run the python-package CI workflow.
Add an Ubuntu-specific step to the python-package workflow to install Qt/OpenGL runtime dependencies (libegl1, libgl1, libopengl0, libxkbcommon-x11-0, libxcb-cursor0). This ensures CI runners have the required libraries for Qt/OpenGL-based install checks; the step runs apt-get update and installs the packages before the existing "Install tools" step.
Author
|
Note : deploy workflow smoke tests failures should be fixed by #55; may require subsequent PRs |
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.
Finalizing the PySide6+multi-camera GUI
Further refinement of GUI added in #35 by @arturoptophys
Remaining TODOs
Features
Improved settings UX/UIWorks as is, delayedMake processor socket design a bit safer by defaultAlso tweaks error handling, UI and UX.
Additional TODOs
see Create 2.0 documentation #39See Update docs TOC and Sphinx excludes DeepLabCut#3201Camera backends unit/smoke testRelated