Conversation
|
hi @maximpavliv can you add a screen shot or short video of this? |
Yes, done! |
|
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). |
There was a problem hiding this comment.
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_downutility to identify CTD models. - Adds
ConditionsSelectionWidgetand integrates it into the layout and dataset‐creation flow. - Refactors combo-box updates via
set_combo_itemsand 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_conditionsto verify behavior for missing paths, unsupported file types, and correct parsing of.pt,.h5, and.jsoninputs.
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)) |
There was a problem hiding this comment.
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.
| match = re.search(r"shuffle(\d+)", str(conditions_path)) | |
| match = re.search(r"shuffle(\d+)", str(conditions_path), re.IGNORECASE) |
| try: | ||
| index = detectors.index(default_detector) | ||
| except ValueError: | ||
| try: | ||
| index = detectors.index("ssdlite") | ||
| except ValueError: | ||
| index = -1 |
There was a problem hiding this comment.
Using -1 will clear the combo box selection; consider defaulting to 0 or checking for an empty list to avoid no-selection states.
| 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 |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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:
The user can choose the type of conditions they want to use in the
QtWidgets.QFileDialog.getOpenFileNamedialog 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).