Visitar URL original
Superanimal_humanbody - add detector widget · DeepLabCut/DeepLabCut@c6ecb0f · GitHub
Skip to content

Commit c6ecb0f

Browse files
committed
Superanimal_humanbody - add detector widget
1 parent f77ccda commit c6ecb0f

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎deeplabcut/gui/tabs/modelzoo.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
)
3434
from deeplabcut.gui.utils import move_to_separate_thread
3535
from deeplabcut.gui.widgets import ClickableLabel
36+
from deeplabcut.pose_estimation_pytorch.apis.utils import TORCHVISION_DETECTORS
3637

3738

3839
class RegExpValidator(QRegularExpressionValidator):
@@ -584,11 +585,17 @@ def _update_detectors(self, super_animal: str) -> None:
584585
)
585586
return
586587

588+
items = []
589+
if self.root.engine == Engine.PYTORCH:
590+
if super_animal == "superanimal_humanbody":
591+
items = list(TORCHVISION_DETECTORS.keys())
592+
else:
593+
items = dlclibrary.get_available_detectors(super_animal)
587594
set_combo_items(
588595
combo_box = self.detector_type_selector,
589-
items = [] if self.root.engine == Engine.TF else dlclibrary.get_available_detectors(super_animal)
596+
items = items
590597
)
591-
set_layout_contents_visible(self.detector_row, self.root.engine == Engine.PYTORCH and super_animal != "superanimal_humanbody")
598+
set_layout_contents_visible(self.detector_row, self.root.engine == Engine.PYTORCH)
592599

593600
def _update_adaptation_visibility(self, super_animal: str):
594601
if self.root.engine == Engine.PYTORCH and super_animal != "superanimal_humanbody":
@@ -607,4 +614,4 @@ def _on_engine_change(self, engine: Engine) -> None:
607614
self.tf_widget.show()
608615

609616
# Hide widgets in detector row
610-
set_layout_contents_visible(self.detector_row, engine == Engine.PYTORCH and self.model_combo.currentText() != "superanimal_humanbody")
617+
set_layout_contents_visible(self.detector_row, engine == Engine.PYTORCH)

0 commit comments

Comments
 (0)