Visitar URL original
minor follow-up adjustments for config GUI validation by deruyter92 · Pull Request #3399 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
guard pose_cfg.get("method") string-type
  • Loading branch information
deruyter92 committed Jul 17, 2026
commit b6d86b043a00e4a8700db645514a2d517bf08b69
5 changes: 4 additions & 1 deletion deeplabcut/gui/displays/selected_shuffle_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,8 @@ def _read_pose_config(self, pose_cfg_path: Path) -> None:

self._engine = Engine.PYTORCH if "pytorch" in pose_cfg_path.stem.lower() else Engine.TF
self._net_type = pose_cfg.get("net_type", "UNKNOWN")
self._is_top_down = self._engine == Engine.PYTORCH and pose_cfg.get("method", "").lower() == "td"

method = pose_cfg.get("method")
self._is_top_down = self._engine == Engine.PYTORCH and isinstance(method, str) and method.lower() == "td"

self.pose_cfg = pose_cfg
3 changes: 2 additions & 1 deletion deeplabcut/gui/tabs/train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def _update_snapshot_selection_widgets_visibility(self):
self.snapshot_selection_widget.show()
# Display detector snapshot selection widget only if in Top-Down mode
pose_cfg = self._shuffle_display.pose_cfg
if pose_cfg is not None and pose_cfg.get("method", "").lower() == "td":
method = pose_cfg.get("method") if pose_cfg is not None else None
if isinstance(method, str) and method.lower() == "td":
self.detector_snapshot_selection_widget.show()
else:
self.detector_snapshot_selection_widget.hide()
Expand Down