Skip to content

Conversation

@arturoptophys
Copy link

This updates the GUI to pyQt6.

New features:

  • Hardware encoding of videos to offload to GPU (nvenc)
  • New processor selection and on the fly change.
  • remote control of the video/ processor - recording over processor socket.
  • visualization of a user definable bounding box
image

arturoptophys and others added 28 commits October 21, 2025 11:22
…modern-python-and-pyqt6

Add Basler and GenTL camera backends for modular capture
…camera-functionality

Rework layout and camera handling controls
…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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the DeepLabCut-live-GUI by migrating from Tkinter to PyQt6 and adding support for DLC3/PyTorch models. The update includes hardware-accelerated video encoding (NVENC), a new processor selection system with on-the-fly changes, remote control capabilities via processor sockets, and user-definable bounding box visualization.

Key Changes:

  • Complete UI rewrite from Tkinter to PyQt6
  • Added support for PyTorch-based DLC models
  • Implemented hardware-accelerated video recording with NVENC
  • Added processor plugin system with remote control capabilities
  • Introduced multiple camera backends (OpenCV, GenTL, Aravis, Basler)

Reviewed changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup.py Updated version to 2.0, Python requirement to >=3.10, replaced dependencies for PyQt6
pyproject.toml Added modern Python packaging configuration with comprehensive test setup
docs/user_guide.md New comprehensive user guide for camera setup, DLC configuration, and recording
docs/timestamp_format.md Documents JSON timestamp format for frame synchronization
docs/features.md Detailed feature documentation including camera backends and processor system
docs/camera_support.md Camera backend comparison and installation guides
docs/aravis_backend.md Aravis backend documentation for GenICam cameras
docs/README.md Documentation index with navigation by use case and topic
dlclivegui/video_recorder.py New video recording module using vidgear with hardware acceleration
dlclivegui/gui.py Complete PyQt6-based GUI implementation replacing Tkinter
dlclivegui/dlc_processor.py DLCLive integration with threading and performance profiling
dlclivegui/config.py Configuration management with dataclasses
dlclivegui/cameras/opencv_backend.py OpenCV camera backend implementation
dlclivegui/cameras/gentl_backend.py GenTL/Harvesters camera backend
dlclivegui/cameras/factory.py Camera backend factory and detection
dlclivegui/cameras/base.py Abstract camera backend base class
dlclivegui/processors/processor_utils.py Processor plugin loading utilities
dlclivegui/processors/dlc_processor_socket.py Socket-based processor with remote control
dlclivegui/processors/PLUGIN_SYSTEM.md Processor plugin system documentation
Comments suppressed due to low confidence (1)

dlclivegui/processors/processor_utils.py:1

  • The docstring 'Returns:' section contains what appears to be an absolute file path rather than a description of the return value. This should describe the returned dictionary structure instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

from dlclivegui.processors.processor_utils import instantiate_from_scan, scan_processor_folder
from dlclivegui.video_recorder import RecorderStats, VideoRecorder

os.environ["CUDA_VISIBLE_DEVICES"] = "1"
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded environment variable and absolute path should not be in production code. These appear to be development-specific settings that should be removed or made configurable through the configuration system.

Suggested change
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
# If you need to restrict CUDA devices, set CUDA_VISIBLE_DEVICES externally or via configuration.

Copilot uses AI. Check for mistakes.

logging.basicConfig(level=logging.INFO)

PATH2MODELS = "C:\\Users\\User\\Repos\\DeepLabCut-live-GUI\\dlc_training\\dlclive"
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded environment variable and absolute path should not be in production code. These appear to be development-specific settings that should be removed or made configurable through the configuration system.

Suggested change
PATH2MODELS = "C:\\Users\\User\\Repos\\DeepLabCut-live-GUI\\dlc_training\\dlclive"
# Use environment variable DLC_PATH2MODELS if set, otherwise default to a relative path
PATH2MODELS = os.environ.get("DLC_PATH2MODELS", str(Path(__file__).parent.parent / "dlc_training" / "dlclive"))

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturoptophys see copilot suggestions; please let me know if you would like assistance!

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
return True

def stop(self) -> None:
"""Request a graceful stop."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants