Skip to content

Processor-related fixes#89

Draft
C-Achard wants to merge 2 commits into
masterfrom
cy/processor-fixes
Draft

Processor-related fixes#89
C-Achard wants to merge 2 commits into
masterfrom
cy/processor-fixes

Conversation

@C-Achard

@C-Achard C-Achard commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • Fix processor field not re-enabling after stopping preview
  • Fix Processor child classes not properly showing up in the UI

Closes #87 and closes #88

C-Achard added 2 commits June 30, 2026 16:18
Wire the processor-control checkbox to refresh DLC control availability and processor status immediately when toggled. Also refresh DLC control enablement when multi-camera preview starts or stops, so the GUI consistently reflects current camera/processor state.
Disable all DLC and processor configuration widgets consistently while inference is active, including the processor-control checkbox. Refactor processor discovery into shared helpers that detect direct and indirect `dlclive.Processor` subclasses, standardize metadata extraction, and reuse the same fallback logic for package scans and file-based loading.
@C-Achard C-Achard requested a review from Copilot June 30, 2026 14:43
@C-Achard C-Achard self-assigned this Jun 30, 2026
@C-Achard C-Achard added enhancement New feature or request gui Related to the GUI itself : windows and fields bugs, UI, UX, ... labels Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses two processor-related UX/plug-in discovery issues in DeepLabCut-live-GUI: (1) ensuring DLC/processor controls correctly re-enable after preview stop, and (2) improving processor class discovery so indirect dlclive.Processor subclasses can be surfaced in the GUI.

Changes:

  • Adds a shared discover_processor_classes() helper to find dlclive.Processor subclasses (including indirect subclasses) and reuses it for both package and file-based processor loading.
  • Hooks allow_processor_ctrl_checkbox changes into UI update routines, and refreshes DLC control enabled-state on multi-camera preview start/stop.
  • Simplifies DLC control enabling logic so processor-related widgets re-enable based on inference state.

Reviewed changes

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

File Description
dlclivegui/processors/processor_utils.py Refactors processor discovery into reusable helpers and uses them for package/file scanning.
dlclivegui/gui/main_window.py Updates signal wiring and control enable/disable logic to restore processor/DLC UI states after preview transitions.

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

Comment on lines 124 to +126
else:
# Fallback: scan for dlclive.Processor subclasses
from dlclive import Processor

processors = {}
for attr_name in dir(mod):
obj = getattr(mod, attr_name)
try:
if isinstance(obj, type) and obj is not Processor and issubclass(obj, Processor):
processors[attr_name] = {
"class": obj,
"name": getattr(obj, "PROCESSOR_NAME", attr_name),
"description": getattr(obj, "PROCESSOR_DESCRIPTION", ""),
"params": getattr(obj, "PROCESSOR_PARAMS", {}),
}
except Exception:
# Non-class or weird metaclass; ignore
pass
processors = discover_processor_classes(mod)
Comment on lines 175 to +177

# Fallback path: discover subclasses of dlclive.Processor
from dlclive import Processor

processors: dict[str, dict] = {}
for name, obj in inspect.getmembers(module, inspect.isclass):
if obj is Processor:
continue
# Guard: module might define other classes; only include Processor subclasses
try:
if issubclass(obj, Processor):
processors[name] = {
"class": obj,
"name": getattr(obj, "PROCESSOR_NAME", name),
"description": getattr(obj, "PROCESSOR_DESCRIPTION", ""),
"params": getattr(obj, "PROCESSOR_PARAMS", {}),
}
except Exception:
# Some "classes" can fail issubclass checks; ignore safely
continue

return processors
return discover_processor_classes(module)
Comment on lines +37 to +42
try:
if obj is processor_base:
return bool(include_base)
return issubclass(obj, processor_base)
except TypeError:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gui Related to the GUI itself : windows and fields bugs, UI, UX, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Processor child classes to be loaded in the GUI Re-enable processor field when disabling preview

2 participants