Visitar URL original
Location Refinement for Top-Down models (#2699) · DeepLabCut/DeepLabCut@6e1bca2 · GitHub
Skip to content

Commit 6e1bca2

Browse files
authored
Location Refinement for Top-Down models (#2699)
* add locref to top-down model heads * use ischecked in analyze videos
1 parent e5d9d54 commit 6e1bca2

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎deeplabcut/gui/tabs/analyze_videos.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ def run_enabled(self):
330330
shuffle = self.root.shuffle_value
331331

332332
videos = list(self.files)
333-
save_as_csv = self.save_as_csv.checkState() == Qt.Checked
334-
save_as_nwb = self.save_as_nwb.checkState() == Qt.Checked
335-
filter_data = self.filter_predictions.checkState() == Qt.Checked
333+
save_as_csv = self.save_as_csv.isChecked()
334+
save_as_nwb = self.save_as_nwb.isChecked()
335+
filter_data = self.filter_predictions.isChecked()
336336
videotype = self.video_selection_widget.videotype_widget.currentText()
337337
try:
338338
create_video_all_detections = (
339-
self.create_detections_video_checkbox.checkState() == Qt.Checked
339+
self.create_detections_video_checkbox.isChecked()
340340
)
341341
except AttributeError:
342342
create_video_all_detections = False
@@ -361,20 +361,19 @@ def run_enabled(self):
361361
track_method=track_method,
362362
)
363363

364-
if self.plot_trajectories.checkState() == Qt.Checked:
364+
if self.plot_trajectories.isChecked():
365365
bdpts = self.bodyparts_list_widget.selected_bodyparts
366366
self.root.logger.debug(
367367
f"Selected body parts for plot_trajectories: {bdpts}"
368368
)
369-
showfig = self.show_trajectory_plots.checkState() == Qt.Checked
370369
deeplabcut.plot_trajectories(
371370
config,
372371
videos=videos,
373372
displayedbodyparts=bdpts,
374373
videotype=videotype,
375374
shuffle=shuffle,
376375
filtered=filter_data,
377-
showfigures=showfig,
376+
showfigures=self.show_trajectory_plots.isChecked(),
378377
track_method=track_method,
379378
)
380379

‎deeplabcut/pose_estimation_pytorch/config/base/head_topdown.yaml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@ predictor:
44
type: HeatmapPredictor
55
apply_sigmoid: false
66
clip_scores: true
7-
location_refinement: false
7+
location_refinement: true
8+
locref_std: 7.2801
89
target_generator:
910
type: HeatmapGaussianGenerator
1011
num_heatmaps: "num_bodyparts"
1112
pos_dist_thresh: 17
1213
heatmap_mode: KEYPOINT
13-
generate_locref: false
14+
generate_locref: true
15+
locref_std: 7.2801
1416
criterion:
1517
heatmap:
1618
type: WeightedMSECriterion
1719
weight: 1.0
20+
locref:
21+
type: WeightedHuberCriterion
22+
weight: 0.05
1823
heatmap_config:
1924
channels:
2025
- "backbone_output_channels"
@@ -23,3 +28,11 @@ heatmap_config:
2328
final_conv:
2429
out_channels: "num_bodyparts"
2530
kernel_size: 1
31+
locref_config:
32+
channels:
33+
- "backbone_output_channels"
34+
kernel_size: []
35+
strides: []
36+
final_conv:
37+
out_channels: "num_bodyparts x 2"
38+
kernel_size: 1

0 commit comments

Comments
 (0)