From 31e482932b05c332df9de92842c9a9a19fbd8530 Mon Sep 17 00:00:00 2001 From: Niels Poulsen Date: Mon, 29 Jul 2024 14:12:22 +0200 Subject: [PATCH 1/2] add locref to top-down model heads --- .../config/base/head_topdown.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/deeplabcut/pose_estimation_pytorch/config/base/head_topdown.yaml b/deeplabcut/pose_estimation_pytorch/config/base/head_topdown.yaml index 8e87759825..d848a2eb50 100644 --- a/deeplabcut/pose_estimation_pytorch/config/base/head_topdown.yaml +++ b/deeplabcut/pose_estimation_pytorch/config/base/head_topdown.yaml @@ -4,17 +4,22 @@ predictor: type: HeatmapPredictor apply_sigmoid: false clip_scores: true - location_refinement: false + location_refinement: true + locref_std: 7.2801 target_generator: type: HeatmapGaussianGenerator num_heatmaps: "num_bodyparts" pos_dist_thresh: 17 heatmap_mode: KEYPOINT - generate_locref: false + generate_locref: true + locref_std: 7.2801 criterion: heatmap: type: WeightedMSECriterion weight: 1.0 + locref: + type: WeightedHuberCriterion + weight: 0.05 heatmap_config: channels: - "backbone_output_channels" @@ -23,3 +28,11 @@ heatmap_config: final_conv: out_channels: "num_bodyparts" kernel_size: 1 +locref_config: + channels: + - "backbone_output_channels" + kernel_size: [] + strides: [] + final_conv: + out_channels: "num_bodyparts x 2" + kernel_size: 1 From 206d6864017bca21228eaaf963f8b73ab5c19208 Mon Sep 17 00:00:00 2001 From: Niels Poulsen Date: Mon, 29 Jul 2024 14:41:51 +0200 Subject: [PATCH 2/2] use ischecked in analyze videos --- deeplabcut/gui/tabs/analyze_videos.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/deeplabcut/gui/tabs/analyze_videos.py b/deeplabcut/gui/tabs/analyze_videos.py index 5e1fa88194..6d289430d2 100644 --- a/deeplabcut/gui/tabs/analyze_videos.py +++ b/deeplabcut/gui/tabs/analyze_videos.py @@ -330,13 +330,13 @@ def run_enabled(self): shuffle = self.root.shuffle_value videos = list(self.files) - save_as_csv = self.save_as_csv.checkState() == Qt.Checked - save_as_nwb = self.save_as_nwb.checkState() == Qt.Checked - filter_data = self.filter_predictions.checkState() == Qt.Checked + save_as_csv = self.save_as_csv.isChecked() + save_as_nwb = self.save_as_nwb.isChecked() + filter_data = self.filter_predictions.isChecked() videotype = self.video_selection_widget.videotype_widget.currentText() try: create_video_all_detections = ( - self.create_detections_video_checkbox.checkState() == Qt.Checked + self.create_detections_video_checkbox.isChecked() ) except AttributeError: create_video_all_detections = False @@ -361,12 +361,11 @@ def run_enabled(self): track_method=track_method, ) - if self.plot_trajectories.checkState() == Qt.Checked: + if self.plot_trajectories.isChecked(): bdpts = self.bodyparts_list_widget.selected_bodyparts self.root.logger.debug( f"Selected body parts for plot_trajectories: {bdpts}" ) - showfig = self.show_trajectory_plots.checkState() == Qt.Checked deeplabcut.plot_trajectories( config, videos=videos, @@ -374,7 +373,7 @@ def run_enabled(self): videotype=videotype, shuffle=shuffle, filtered=filter_data, - showfigures=showfig, + showfigures=self.show_trajectory_plots.isChecked(), track_method=track_method, )