FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUCTD GUI integration by maximpavliv · Pull Request #3016 · DeepLabCut/DeepLabCut · GitHub

BUCTD GUI integration - #3016

Merged
MMathisLab merged 11 commits into
mainfrom
maxim/buctd_gui_integration
Jun 30, 2025
Merged

BUCTD GUI integration#3016
MMathisLab merged 11 commits into
mainfrom
maxim/buctd_gui_integration

Conversation

maximpavliv commented Jun 24, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

This Pull Request adds a widget to select conditions to the Create training dataset tab in the DeepLabCut GUI.

The widget is visible only when a CTD model is selected.
The conditions can be one of the following:

  • A pytorch model snapshot (a check is applied to verify if the selected model is Bottom-Up , an warning message is displayed if that is not the case)
  • Predictions stored in a .h5 file
  • Predictions stored in a .json file

The user can choose the type of conditions they want to use in the QtWidgets.QFileDialog.getOpenFileName dialog using the filter (in the bottom-right corner of the window).

If a CTD model is selected but conditions are missing - the shuffle creation fails (a warning message is displayed).

maximpavliv added GUI issues relating to GUI DLC3.0🔥 CTD Contidional Top-Down labels Jun 24, 2025

Copy link
Copy Markdown
Member

hi @maximpavliv can you add a screen shot or short video of this?

Copy link
Copy Markdown
Contributor Author

hi @maximpavliv can you add a screen shot or short video of this?

Yes, done!

AlexEMG commented Jun 26, 2025

Copy link
Copy Markdown
Member

For training -- it should also link to the docs & recommendations. I'd also suggest to say that it's typically preferable to use generative sampling (so no predictions during training).

MMathisLab requested a review from Copilot June 26, 2025 14:07

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

Adds support for selecting conditional top-down (CTD) model conditions in the DeepLabCut GUI’s Create Training Dataset tab.

  • Introduces is_model_cond_top_down utility to identify CTD models.
  • Adds ConditionsSelectionWidget and integrates it into the layout and dataset‐creation flow.
  • Refactors combo-box updates via set_combo_items and centralizes message‐box creation.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
deeplabcut/pose_estimation_pytorch/config/utils.py Added is_model_cond_top_down to detect CTD models.
deeplabcut/pose_estimation_pytorch/config/init.py Exported new is_model_cond_top_down util.
deeplabcut/pose_estimation_pytorch/init.py Exported new is_model_cond_top_down util.
deeplabcut/gui/tabs/create_training_dataset.py Integrated CTD conditions widget, refactored combo updates, and added _build_ctd_conditions.
deeplabcut/gui/components.py Added ConditionsSelectionWidget, set_combo_items, and shared message-box helpers.
Comments suppressed due to low confidence (2)

deeplabcut/gui/components.py:361

  • [nitpick] Use consistent casing for acronyms: change "Json predictions" to "JSON predictions" for clarity.
        json_prediction_label = "Json predictions"

deeplabcut/gui/tabs/create_training_dataset.py:422

  • Add unit tests for _build_ctd_conditions to verify behavior for missing paths, unsupported file types, and correct parsing of .pt, .h5, and .json inputs.
    def _build_ctd_conditions(

if conditions_path.suffix.lower() in [".h5", ".json"]:
return conditions_path
elif conditions_path.suffix.lower() == ".pt":
match = re.search(r"shuffle(\d+)", str(conditions_path))

Copilot AI Jun 26, 2025

Copy link

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The regex is case-sensitive and won’t match filenames with uppercase "Shuffle"; consider using re.IGNORECASE or normalizing the string to lowercase before searching.

Suggested change
match = re.search(r"shuffle(\d+)", str(conditions_path))
match = re.search(r"shuffle(\d+)", str(conditions_path), re.IGNORECASE)

Copilot uses AI. Check for mistakes.
Comment on lines +520 to +526
try:
index = detectors.index(default_detector)
except ValueError:
try:
index = detectors.index("ssdlite")
except ValueError:
index = -1

Copilot AI Jun 26, 2025

Copy link

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Using -1 will clear the combo box selection; consider defaulting to 0 or checking for an empty list to avoid no-selection states.

Suggested change
try:
index = detectors.index(default_detector)
except ValueError:
try:
index = detectors.index("ssdlite")
except ValueError:
index = -1
if not detectors:
index = 0 # Default to the first item if the list is empty
else:
try:
index = detectors.index(default_detector)
except ValueError:
try:
index = detectors.index("ssdlite")
except ValueError:
index = 0 # Default to the first item if no match is found

Copilot uses AI. Check for mistakes.
MMathisLab and others added 2 commits June 26, 2025 16:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
MMathisLab merged commit 820478c into main Jun 30, 2025
MMathisLab deleted the maxim/buctd_gui_integration branch June 30, 2025 03:25
This was referenced Jul 3, 2025
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

Labels

CTD Contidional Top-Down DLC3.0🔥 GUI issues relating to GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL