Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
326 commits
Select commit Hold shift + click to select a range
3d22a43
documentation updates (#173)
n-poulsen Mar 19, 2024
e7d53d8
Prune PAF graph when exceedingly large (#180)
jeylau Apr 4, 2024
dee2f60
Fix naming and use non-native dialog (#181)
jeylau Apr 15, 2024
6a94f9f
bug fix: only compute PAFs during evaluation (#183)
n-poulsen Apr 17, 2024
3806551
niels/logger_improvements (#175)
n-poulsen Apr 17, 2024
8b93e0d
niels/batch_rescale (#177)
n-poulsen Apr 22, 2024
c25919a
merged public changes
n-poulsen May 1, 2024
277a3e2
Merge pull request #186 from AlexEMG/niels/update_public_code
n-poulsen May 1, 2024
b09f5e8
fix missing import
n-poulsen May 1, 2024
050c524
niels/fix_torch_superanimal_config (#187)
n-poulsen May 10, 2024
bc07701
Fix top-down video analysis scorer (#192)
n-poulsen May 15, 2024
0aac490
Minor compatibility fixes (#194)
jeylau May 23, 2024
c804eb4
changes to defaults, bug fixes, albumentations CoarseDropout, top-dow…
n-poulsen May 23, 2024
b59864a
finetune SuperAnimal models (#193)
n-poulsen May 29, 2024
5b0f23e
niels/fix_model_stride (#196)
n-poulsen May 31, 2024
3bf862a
Generalized data converter (#195)
yeshaokai Jun 6, 2024
1154798
prepare for 3.0.0rc1 (#203)
MMathisLab Jun 7, 2024
17fc56b
Shaokai/dev (#188)
yeshaokai Jun 7, 2024
d00be9a
niels/create_training_dataset_improvements (#198)
n-poulsen Jun 7, 2024
3037e40
niels/learning_stats_logger (#201)
n-poulsen Jun 7, 2024
b99efed
bug fix: multiple engine selectors in toolbar
n-poulsen Jun 7, 2024
9c807b2
Fix evaluation of ID prediction accuracy (#182)
jeylau Jun 7, 2024
f826753
Merge pull request #205 from AlexEMG/niels/gui_bug_fix_engine_selector
MMathisLab Jun 7, 2024
025ee75
Merge pull request #206 from AlexEMG/public
n-poulsen Jun 7, 2024
2254c51
Update codespell.yml
MMathisLab Jun 7, 2024
81bf6ee
Update ma_dlc.py
MMathisLab Jun 7, 2024
6757f7c
Update ma_dlc_dataframe.py
MMathisLab Jun 7, 2024
058d0bb
Update materialize.py
MMathisLab Jun 7, 2024
0211e13
Update materialize.py
MMathisLab Jun 7, 2024
06789a8
Merge pull request #209 from AlexEMG/MMathisLab-SPELLING
MMathisLab Jun 7, 2024
3d14777
icons for GUI engine
MMathisLab Jun 7, 2024
183f6f3
niels - bug fixes (#210)
n-poulsen Jun 7, 2024
02621dd
Automatically open napari to view labeled images (#214)
jeylau Jun 7, 2024
c3e7cf6
Shaokai/memory replay (#204)
yeshaokai Jun 8, 2024
27b2e95
Add button to edit conversion table (#213)
jeylau Jun 8, 2024
4ea9845
Luc/multi gpu training (#174)
LucZot Jun 8, 2024
6efb2e3
changed default net in GUI (#215)
n-poulsen Jun 8, 2024
7ba531c
colormaps dlc3 (#216)
MMathisLab Jun 8, 2024
5a2bb8c
niels - GUI detector epochs (#217)
n-poulsen Jun 9, 2024
6705364
filter modelzoo options based on engine (#218)
n-poulsen Jun 9, 2024
179947b
Shaokai/fix docs for modelzoo apis (#212)
yeshaokai Jun 9, 2024
89ff492
Fixed bugs in analyze_images and add superanimal image inference (#208)
yeshaokai Jun 9, 2024
4fab02d
Merge pull request #211 from AlexEMG/MMathisLab-gui-engine-icons
jeylau Jun 10, 2024
02ba04c
Open the confusion matrix when editing conversion tables (#223)
jeylau Jun 10, 2024
6cba9cb
bug fix: future annotations (#225)
n-poulsen Jun 10, 2024
b74b67c
Add reactive engine icons (#224)
jeylau Jun 10, 2024
afba0c1
Hide edit conversion table button if unnecessary (#222)
jeylau Jun 10, 2024
1713f72
bug fix: mps float64 for target weights (#227)
n-poulsen Jun 10, 2024
3aa413b
Shaokai/customized checkpoints (#220)
yeshaokai Jun 11, 2024
cf0ebe7
Shaokai/improve video adaptation (#221)
yeshaokai Jun 11, 2024
30344eb
niels/default configuration updates (#226)
n-poulsen Jun 11, 2024
52a2385
Shaokai/customized configs (#228)
yeshaokai Jun 11, 2024
6e6f1f2
niels - GUI improvements displaying shuffle information (#230)
n-poulsen Jun 11, 2024
a550d0a
added pycocotools extra (#219)
n-poulsen Jun 11, 2024
35b51a8
bug fix (#232)
n-poulsen Jun 11, 2024
a4e87d6
Fix confusion matrix image path (#231)
jeylau Jun 11, 2024
58e67a5
Make button responsive to change in weight init selection (#235)
jeylau Jun 11, 2024
8767a1c
Stricter test for the presence of conversion tables (#236)
jeylau Jun 11, 2024
6f96f43
niels - GUI fix CheckBoxes (#234)
n-poulsen Jun 11, 2024
e95d1f0
niels/fix_evaluate_network (#237)
n-poulsen Jun 11, 2024
55cc604
Open all labeled images as stack (#240)
jeylau Jun 11, 2024
8716805
Update python-package.yml (#238)
MMathisLab Jun 11, 2024
66d46ae
niels - modelzoo video inference fixes (#239)
n-poulsen Jun 11, 2024
96679d0
print to logging (#241)
n-poulsen Jun 11, 2024
9dac79d
Shaokai/add docs link to modelzootab (#233)
yeshaokai Jun 11, 2024
b6ec1ad
Update video_inference.py (#242)
MMathisLab Jun 11, 2024
626513d
Remove unused tabs (#245)
jeylau Jun 11, 2024
39ff4ea
hide plot maps for torch (#243)
n-poulsen Jun 11, 2024
e454e90
niels - modelzoo tab params (#246)
n-poulsen Jun 11, 2024
3d2d47e
[wip] niels - api logging (#244)
n-poulsen Jun 11, 2024
e6ab62d
isort + black
n-poulsen Jun 12, 2024
a910876
fixed mAP computation
n-poulsen Jun 12, 2024
7845a6f
warnings when TF is not installed (#252)
n-poulsen Jun 12, 2024
42ad20f
Add modelzoo's destination folder widget (#247)
jeylau Jun 12, 2024
571818b
improved docs (#249)
n-poulsen Jun 12, 2024
8c39abb
fixed failing tests due to bad path (#250)
n-poulsen Jun 12, 2024
6b94820
niels - center keypoint computation (#255)
n-poulsen Jun 12, 2024
08c34ee
Use napari's default plugin to simply view images (#256)
jeylau Jun 12, 2024
499ce0e
Update window.py
MMathisLab Jun 12, 2024
b65f6ac
Update window.py
MMathisLab Jun 12, 2024
e6c04b9
Merge branch 'main' into niels/map_computation_fix
MMathisLab Jun 12, 2024
8998e2b
drop windows and 3.11 for the rapid testing ongoing
AlexEMG Jun 12, 2024
f477bb7
Merge branch 'main' into niels/map_computation_fix
AlexEMG Jun 12, 2024
f4dec5f
Merge pull request #253 from AlexEMG/niels/map_computation_fix
AlexEMG Jun 12, 2024
8558d8a
niels - detector variant for sa (#251)
n-poulsen Jun 12, 2024
0531560
deal with no detectors when evaluating (#258)
n-poulsen Jun 12, 2024
59a12d4
niels - add modelzoo checkpoints to gitignore (#260)
n-poulsen Jun 13, 2024
0e9ea58
niels - bug fix train fraction (#259)
n-poulsen Jun 13, 2024
8682d78
Update setup.py
MMathisLab Jun 13, 2024
0f2ea8f
some adaptation needed in generalized data converter for benchmark (…
yeshaokai Jun 13, 2024
fb05e28
Update python-package.yml
MMathisLab Jun 13, 2024
8e06d7f
Merge branch 'main' into pytorch_dlc
MMathisLab Jun 13, 2024
a4bcbb9
niels - COCO mAP tests (#261)
n-poulsen Jun 14, 2024
28eb306
updated default value for draw skeleton checkbox (#263)
n-poulsen Jun 14, 2024
8bd646d
cleaned benchmarking scripts (#264)
n-poulsen Jun 14, 2024
30f06f5
Merge branch 'main' into pytorch_dlc
n-poulsen Jun 14, 2024
f37250d
updated merge
n-poulsen Jun 14, 2024
f93c59d
fixed openfield demo config
n-poulsen Jun 14, 2024
4286cbc
fixed broken tests
n-poulsen Jun 14, 2024
2a02eb5
Merge branch 'main' into pytorch_dlc
MMathisLab Jun 14, 2024
82c27a5
update requirements.txt for CI/CD
n-poulsen Jun 14, 2024
38c5cba
pin numpy version for CI/CD
n-poulsen Jun 14, 2024
17f5259
bounding box to list, unpin numpy
n-poulsen Jun 14, 2024
f69cea7
Update config.yml
MMathisLab Jun 15, 2024
1d7fe9e
Update requirements.txt
MMathisLab Jun 15, 2024
b59f22e
Update python-package.yml
MMathisLab Jun 15, 2024
bd0bbc5
set engine when creating training datasets in testscripts
n-poulsen Jun 17, 2024
d248de2
Merge branch 'main' into pytorch_dlc
n-poulsen Jun 17, 2024
8a1f71d
set engine in testscript_cli
n-poulsen Jun 17, 2024
40cba0c
bug fix: parameter order
n-poulsen Jun 17, 2024
853b7fd
Fix PySide6 AttributeError and uninitialized variable (#2622)
jeylau Jun 18, 2024
374025c
Merge branch 'main' into pytorch_dlc
MMathisLab Jun 19, 2024
768296c
Merge branch 'DeepLabCut:main' into master
yeshaokai Jun 20, 2024
882f920
Added notebook for superanimal pytorch
yeshaokai Jun 20, 2024
11cedcc
Niels/pcutoff arg (#2630)
n-poulsen Jun 20, 2024
4be4a70
Update COLAB_Pytorch_SuperAnimal.ipynb
MMathisLab Jun 20, 2024
ed8a979
Update COLAB_Pytorch_SuperAnimal.ipynb
MMathisLab Jun 20, 2024
624134b
Update COLAB_Pytorch_SuperAnimal.ipynb
MMathisLab Jun 20, 2024
57bcb3e
Fix video overwrite (#2633)
jeylau Jun 24, 2024
e52b0ff
Visually signal end of super animal video inference (#2637)
jeylau Jun 26, 2024
7c123b3
Merge branch 'pytorch_dlc' into shaokai/educational_superanimal_notebook
n-poulsen Jun 26, 2024
d68a137
cleaned notebook and added bbox_threshold to analyze_superanimal_images
n-poulsen Jun 26, 2024
830f4ac
worked on superanimal notebook
n-poulsen Jul 2, 2024
8c0c0f4
Fix GUI bugs (#2649)
jeylau Jul 2, 2024
89aebaf
Filter image names when generating test data (#2650)
jeylau Jul 3, 2024
66acb3d
fixed symlink creation for keypoint matching
n-poulsen Jul 4, 2024
ba39fd5
renamed COLAB to YOURDATA
n-poulsen Jul 4, 2024
24cc195
fixed some bugs and cleaned the notebook. added more print statements…
n-poulsen Jul 4, 2024
c99a199
installed latest version of DeepLabCut instead of from pypi
n-poulsen Jul 4, 2024
f59dc69
changed default training parameters
n-poulsen Jul 4, 2024
3877be3
added option to not have use symlinks for keypoint matching
n-poulsen Jul 4, 2024
97bb2a1
no symlinks for keypoint matching in COLAB
n-poulsen Jul 4, 2024
67903f0
set default eval interval to 10, add superanimal_analyze_images to init
n-poulsen Jul 4, 2024
faba3ac
do not copy images or create symlinks for memory replay
n-poulsen Jul 4, 2024
2972982
RC2 flag
AlexEMG Jul 6, 2024
27a58af
fixed memory replay to only run once
n-poulsen Jul 9, 2024
7688cc0
Fix unreachable line (#2673)
jeylau Jul 16, 2024
20dac7d
Fix and decouple video rotation utility (#2653)
jeylau Jul 16, 2024
61cfdba
merge named snapshot evaluation into pytorch_dlc (#2657)
n-poulsen Jul 16, 2024
83f1acb
Handle internet connectivity issues (#2672)
jeylau Jul 16, 2024
0c45b98
Merge pull request #2629 from yeshaokai/shaokai/educational_superanim…
n-poulsen Jul 19, 2024
416322c
merge main to `pytorch_dlc` (#2677)
n-poulsen Jul 19, 2024
a7c0d58
Update train.py: avoids error on 'unique_bodyparts' (#2668)
Zelin2001 Jul 19, 2024
17ccb5f
update the default PAF config
n-poulsen Jul 19, 2024
a1d876e
Merge pull request #2678 from DeepLabCut/niels/paf_default_update
n-poulsen Jul 19, 2024
35d10a1
New detector options and better detector integration (#2676)
n-poulsen Jul 19, 2024
7f15ffb
backwards compatibility (#2681)
n-poulsen Jul 19, 2024
dc908b9
evaluation refactor (#2679)
n-poulsen Jul 19, 2024
7232eac
modified: deeplabcut/pose_estimation_pytorch/apis/analyze_videos.p…
Zelin2001 Jul 23, 2024
5990197
rc 3 release
AlexEMG Jul 24, 2024
e5d9d54
Fix import (#2691)
jeylau Jul 25, 2024
6e1bca2
Location Refinement for Top-Down models (#2699)
n-poulsen Aug 2, 2024
24ba111
rc4
AlexEMG Aug 6, 2024
9421aad
learning identity - add identity predictor (#2707)
n-poulsen Aug 8, 2024
8a294c6
batched inference (#2708)
n-poulsen Aug 9, 2024
ed9492b
bug fixes - identity evaluation and ellipse tracking (#2709)
n-poulsen Aug 10, 2024
02fa64a
bug fix: need to pick one more neighbor as picked contains the n+1th …
n-poulsen Aug 26, 2024
f86856c
Minimal backward compatibility (#2713)
AlexEMG Aug 26, 2024
a618192
Documentation Improvements - DeepLabCut PyTorch Code (#2714)
AlexEMG Aug 26, 2024
094e826
Merge branch 'main' into niels/2024_09_02_main_update
n-poulsen Sep 2, 2024
78cc44e
Merge pull request #2731 from DeepLabCut/niels/2024_09_02_main_update
MMathisLab Sep 2, 2024
55de11b
Make 3D Triangulate possible with pytorch_dlc branch and MA project (…
Zelin2001 Sep 9, 2024
597cf6b
make parenting video name changes backwards compatible; add code to r…
n-poulsen Sep 13, 2024
5f41812
Adding cropping to pose_estimation_pytorch/apis/analyze_videos.py (#2…
YankoFelipe Sep 30, 2024
56cd632
pytorch_dlc - Small updates and bug fixes (#2747)
n-poulsen Oct 1, 2024
6f2986d
calc_similarity_with .py ZeroDivisionError: float division by zeros v…
SowonKIMM Oct 1, 2024
28840b4
update version (#2748)
AlexEMG Oct 2, 2024
ffcd290
SuperAnimal Model Updates (#2756)
n-poulsen Oct 18, 2024
2668ae5
lowercase the video filenames when creating a project (#2763)
n-poulsen Oct 22, 2024
051f5cd
Train: read gpus from config if not passed by param (#2744) (#2764)
maximpavliv Oct 23, 2024
58bc751
.gitignore IDE configs (#2765)
maximpavliv Oct 24, 2024
17d7205
Fix bug introduced in PR #2764 (#2772)
maximpavliv Nov 1, 2024
dbcbbdd
PAF models - fix full data saved (#2776)
n-poulsen Nov 8, 2024
fc02eac
Resume training from existing snapshots option in GUI (#2774)
maximpavliv Nov 8, 2024
dd0fbfa
Improvements to the training UX (#2775)
n-poulsen Nov 8, 2024
627a8bf
fixed failing tests (#2778)
n-poulsen Nov 8, 2024
48a156d
update version
AlexEMG Nov 9, 2024
7e91cb0
Merge branch 'main' into niels/2024_11_11_merge_main_changes
n-poulsen Nov 11, 2024
4518153
Merge pull request #2779 from DeepLabCut/niels/2024_11_11_merge_main_…
maximpavliv Nov 11, 2024
48c5969
bug fix: None has no lower() attribute (#2780)
n-poulsen Nov 11, 2024
add09aa
Use architecture-specific snapshots prefixes in video adaptation (#2781)
maximpavliv Nov 14, 2024
e4ca5bc
Video Analysis with Identity - Lowering memory footprint (#2785)
n-poulsen Nov 14, 2024
3d62bce
Timeout retrieving latest package version from the Web (#2782)
maximpavliv Nov 14, 2024
b9a80bd
Load scheduler state when resuming training (#2788)
n-poulsen Nov 21, 2024
89ac4a0
DeepLabCut 3.0 - Video Analysis with `use_shelve=True` (#2790)
n-poulsen Nov 22, 2024
73ddd56
Fix: extra snapshots not removed when best snapshot saved (#2793)
xiu-cs Nov 25, 2024
82319a1
Fix: Video Analysis for Single Animal projects (#2798)
n-poulsen Nov 28, 2024
5e24956
Model Output Visualization for PyTorch Models (#2799)
n-poulsen Dec 2, 2024
f61a3ca
fix failing tests
n-poulsen Dec 2, 2024
d940483
Add Functions for Visualizing COCO Predictions and Ground Truth (#2792)
xiu-cs Dec 2, 2024
5b6c8b7
DLC 3.0 - Function to export PyTorch models (#2800)
n-poulsen Dec 3, 2024
3145fea
`KeypointAwareCrop`: uniform sampling when no keypoints are present (…
n-poulsen Dec 3, 2024
14a2ade
Fix version check timeout, add tests (#2805)
maximpavliv Dec 6, 2024
731f12a
Revert "Fix version check timeout, add tests (#2805)" (#2807)
n-poulsen Dec 6, 2024
68d3503
Merge branch 'main' into pytorch_dlc
MMathisLab Dec 9, 2024
dd0fd75
PyTorch model evaluation - `per_keypoint_evaluation` and `comparisonb…
n-poulsen Dec 10, 2024
431bd7e
Prune PAF graphs before evaluation (#2813)
n-poulsen Dec 13, 2024
9b0d7f4
Plot detector's bboxes if Top-Down architecture (#2791)
maximpavliv Dec 13, 2024
73f5248
`superanimal_analyze_images`: improve plotting functions (#2815)
n-poulsen Dec 16, 2024
198fc74
Update `superanimal_analyze_images` plotting (#2817)
n-poulsen Dec 18, 2024
fd6916b
Set `weights_only=True` as a default when loading snapshot weights. (…
n-poulsen Dec 19, 2024
c040f32
fix failing test
n-poulsen Dec 19, 2024
883a016
fix failing CI test
n-poulsen Dec 19, 2024
4c732d2
replace np.nan with float('nan') in detector snapshots
n-poulsen Dec 19, 2024
2fe72e3
Implement missing arguments for PyTorch models (#2816)
n-poulsen Dec 19, 2024
180c7ee
convert all metrics to float from np.float64
n-poulsen Dec 20, 2024
3130038
Add missing positional args (#2819)
maximpavliv Dec 20, 2024
b7f1c3d
Revert "Add missing positional args (#2819)"
maximpavliv Dec 20, 2024
1d26325
New Top-Down Pose Estimation Model - RTMPose (#2795)
n-poulsen Dec 20, 2024
5a299b6
updated SA demo (#2814)
MMathisLab Dec 22, 2024
1d6ce0d
Improved loading of snapshot weights with` torch.load(..., weights_on…
MMathisLab Dec 23, 2024
ae612e0
fix missing full data file for SA tensorflow models (#2826)
n-poulsen Jan 7, 2025
20b6e49
Pins `numpy<2`, fix svd for `scipy>=1.11.0` (#2827)
n-poulsen Jan 7, 2025
49b1f06
unpin scipy
n-poulsen Jan 7, 2025
c9ab9c2
restore build skeleton btn (#2831)
maximpavliv Jan 10, 2025
d03da3c
Improve `deeplabcut.pose_estimation_pytorch` imports (#2833)
n-poulsen Jan 10, 2025
9687dcb
Improve train_network docstring (#2836)
maximpavliv Jan 13, 2025
db23d67
Update utils.py (#2841)
nattse Jan 21, 2025
ea64eee
Update docs video_inference_superanimal() (#2848)
maximpavliv Jan 27, 2025
12c3afb
Fix - setting cropping parameters in `analyze_videos` for PyTorch mod…
n-poulsen Jan 27, 2025
b2d2feb
Merge branch 'main' into pytorch_dlc
n-poulsen Jan 31, 2025
07c6fd8
Improvements to default configs (#2860)
n-poulsen Feb 5, 2025
e128877
make default crop sampling size to multiple of 32
n-poulsen Feb 5, 2025
45d4d3d
Dynamic update of pytorch config with dot notation (#2859)
maximpavliv Feb 5, 2025
877f08f
fix broken arg for pytorch display iters (#2865)
n-poulsen Feb 7, 2025
40465e1
fix - evaluation during training for ma models
n-poulsen Feb 7, 2025
394db6a
ReID Tracking dataset creation for PyTorch models (#2861)
n-poulsen Feb 7, 2025
6f1cb1e
Merge branch 'main' into maxim/merge_main_20250211
maximpavliv Feb 11, 2025
5b6c22a
Merge pull request #2876 from DeepLabCut/maxim/merge_main_20250211
maximpavliv Feb 11, 2025
d7d55e2
fix - afterwards evaluation for ma models (#2872)
Zelin2001 Feb 14, 2025
943b728
Fix check version timeout Version 2 (compatible with Windows and MacO…
maximpavliv Feb 15, 2025
08cb7ee
fix entrypoint for dlc (#2863)
hmaarrfk Feb 15, 2025
a31cca5
fix entrypoint (#2883)
maximpavliv Feb 17, 2025
fd57685
Fix assert in compute_detection_rmse() (#2879)
maximpavliv Feb 17, 2025
19a4280
Rename command back to dlc (#2885)
maximpavliv Feb 17, 2025
0f08b76
Merge branch 'main' into pytorch_dlc
n-poulsen Feb 18, 2025
5ff2eec
Merge branch 'main' into pytorch_dlc
n-poulsen Feb 18, 2025
705083d
add animal_names parameter for pytorch models (#2890)
n-poulsen Feb 18, 2025
b2bd75a
Improvements to the create project GUI (#2892)
n-poulsen Feb 21, 2025
cfbaaf6
Set pcutoff per-bodypart with the when evaluating PyTorch models (#2889)
n-poulsen Feb 21, 2025
3cb4b4e
Fix Codespell (#2899)
maximpavliv Feb 24, 2025
59257c7
Fixes failing tests (#2901)
n-poulsen Feb 25, 2025
7889cf2
fix failing tests
n-poulsen Feb 25, 2025
70fd919
Implement create_pretrained_project() for Pytorch engine (#2897)
maximpavliv Feb 25, 2025
d149913
Improve tracklet creation for ID-only tracking (#2903)
n-poulsen Feb 26, 2025
e1d2b25
[WIP] DLC 3.0 - Review documentation (#2881)
maximpavliv Feb 28, 2025
7b43b35
DeepLabCut 3.0 - Updates to COLABs and Notebooks for the PyTorch Engi…
n-poulsen Feb 28, 2025
d88d2c0
Option to export top-down models without detectors (#2911)
n-poulsen Feb 28, 2025
2bd3b75
Merge branch 'main' into pytorch_dlc
n-poulsen Feb 28, 2025
ad5c0c4
fix typo
n-poulsen Feb 28, 2025
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
Set pcutoff per-bodypart with the when evaluating PyTorch models (#2889)
  • Loading branch information
n-poulsen authored Feb 21, 2025
commit cfbaaf690c74bb4603e28b098fe083c5fc257bfd
22 changes: 22 additions & 0 deletions deeplabcut/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def evaluate_network(
modelprefix: str = "",
per_keypoint_evaluation: bool = False,
snapshots_to_evaluate: list[str] | None = None,
pcutoff: float | list[float] | dict[str, float] | None = None,
engine: Engine | None = None,
**torch_kwargs,
):
Expand Down Expand Up @@ -449,6 +450,16 @@ def evaluate_network(
snapshots_to_evaluate: List[str], optional, default=None
List of snapshot names to evaluate (e.g. ["snapshot-5000", "snapshot-7500"]).

pcutoff: float | list[float] | dict[str, float] | None, default=None
Only for the PyTorch engine. For the TensorFlow engine, please set the pcutoff
in the `config.yaml` file.
The cutoff to use for computing evaluation metrics. When `None` (default), the
cutoff will be loaded from the project config. If a list is provided, there
should be one value for each bodypart and one value for each unique bodypart
(if there are any). If a dict is provided, the keys should be bodyparts
mapping to pcutoff values for each bodypart. Bodyparts that are not defined
in the dict will have pcutoff set to 0.6.

engine: Engine, optional, default = None.
The default behavior loads the engine for the shuffle from the metadata. You can
overwrite this by passing the engine as an argument, but this should generally
Expand Down Expand Up @@ -490,6 +501,16 @@ def evaluate_network(
plotting="individual",
)

If you have a PyTorch model for which you want to set a different p-cutoff for
"left_ear" and "right_ear" bodyparts, and keep the one set in the project config
for other bodyparts:

>>> deeplabcut.evaluate_network(
>>> "/analysis/project/reaching-task/config.yaml",
>>> Shuffles=[0, 1],
>>> pcutoff={"left_ear": 0.8, "right_ear": 0.8},
>>> )

Note: This defaults to standard plotting for single-animal projects.
"""
if engine is None:
Expand Down Expand Up @@ -543,6 +564,7 @@ def evaluate_network(
comparison_bodyparts=comparisonbodyparts,
per_keypoint_evaluation=per_keypoint_evaluation,
modelprefix=modelprefix,
pcutoff=pcutoff,
**torch_kwargs,
)

Expand Down
67 changes: 51 additions & 16 deletions deeplabcut/core/metrics/distance_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def match_predictions_for_rmse(
def compute_rmse(
data: list[tuple[np.ndarray, np.ndarray]],
single_animal: bool,
pcutoff: float,
pcutoff: float | list[float],
data_unique: list[tuple[np.ndarray, np.ndarray]] | None = None,
per_keypoint_results: bool = False,
oks_bbox_margin: float = 0.0,
Expand All @@ -245,7 +245,9 @@ def compute_rmse(
num_bpts, 3). For the GT, the 3 coordinates are (x, y, visibility) while for
the pose they are (x, y, confidence score).
single_animal: Whether this is a single animal dataset.
pcutoff: The p-cutoff to use to compute RMSE.
pcutoff: The p-cutoff to use to compute RMSE. If a list, the cutoff for each
bodypart is set individually. The list must have length num_bodyparts +
num_unique_bodyparts.
data_unique: Unique bodypart ground truth and predictions to include in RMSE
computations, if there are any such bodyparts.
per_keypoint_results: Whether to compute the RMSE for each individual keypoint.
Expand All @@ -272,8 +274,12 @@ def compute_rmse(

error, support, cutoff_error, cutoff_support = 0, 0, 0, 0
if pixel_errors is not None:
bpt_cutoffs = pcutoff
if not isinstance(pcutoff, float):
bpt_cutoffs = pcutoff[:pixel_errors.shape[1]]

error, support, cutoff_error, cutoff_support = collect_pixel_errors(
pixel_errors, keypoint_scores, pcutoff,
pixel_errors, keypoint_scores, bpt_cutoffs,
)

unique_pixel_errors, unique_keypoint_scores = None, None
Expand All @@ -283,8 +289,11 @@ def compute_rmse(
unique_pixel_errors = np.stack([m.pixel_errors() for m in u_matches])
unique_keypoint_scores = np.stack([m.keypoint_scores() for m in u_matches])

bpt_cutoffs = pcutoff
if not isinstance(pcutoff, float):
bpt_cutoffs = pcutoff[-unique_pixel_errors.shape[1]:]
u_error, u_support, u_cutoff_error, u_cutoff_support = collect_pixel_errors(
unique_pixel_errors, unique_keypoint_scores, pcutoff,
unique_pixel_errors, unique_keypoint_scores, bpt_cutoffs,
)
error += u_error
support += u_support
Expand Down Expand Up @@ -314,7 +323,7 @@ def compute_rmse(

def compute_detection_rmse(
data: list[tuple[np.ndarray, np.ndarray]],
pcutoff: float,
pcutoff: float | list[float],
data_unique: list[tuple[np.ndarray, np.ndarray]] | None = None,
) -> tuple[float, float]:
"""Computes the detection RMSE for pose predictions.
Expand All @@ -331,7 +340,9 @@ def compute_detection_rmse(
num_bpts, 3) and predicted_poses is an array of shape (num_predictions,
num_bpts, 3). For the GT, the 3 coordinates are (x, y, visibility) while for
the pose they are (x, y, confidence score).
pcutoff: The p-cutoff to use to compute RMSE.
pcutoff: The p-cutoff to use to compute RMSE. If a list, the cutoff for each
bodypart is set individually. The list must have length num_bodyparts +
num_unique_bodyparts.
data_unique: Unique bodypart ground truth and predictions to include in RMSE
computations, if there are any such bodyparts.

Expand All @@ -340,7 +351,7 @@ def compute_detection_rmse(
score below the pcutoff.
"""
distances = []
scores = []
distances_cutoff = []
for image_gt, image_pred in data:
image_gt = image_gt.transpose((1, 0, 2)) # to (num_bpts, num_gt_individuals, 3)
image_pred = image_pred.transpose((1, 0, 2)) # to (num_bpts, num_pred, 3)
Expand All @@ -352,26 +363,50 @@ def compute_detection_rmse(
if len(bpt_gt) == 0 or len(bpt_pred) == 0:
continue

if isinstance(pcutoff, float):
bpt_pcutoff = pcutoff
else:
bpt_pcutoff = pcutoff[bpt_index]

# assignment of predicted bodyparts to ground truth
neighbors = find_closest_neighbors(bpt_gt, bpt_pred, k=3)
for gt_index, pred_index in enumerate(neighbors):
if pred_index != -1:
gt = bpt_gt[gt_index]
pred = bpt_pred[pred_index]
distances.append(np.linalg.norm(gt[:2] - pred[:2]))
scores.append(bpt_pred[pred_index, 2])
dist = np.linalg.norm(gt[:2] - pred[:2])
distances.append(dist)

score = bpt_pred[pred_index, 2]
if score >= bpt_pcutoff:
distances_cutoff.append(dist)

if data_unique is not None:
for image_gt, image_pred in data_unique:
assert len(image_gt) <= 1 and len(image_pred) <= 1, (
f"Unique GT an predictions must have length 0 or 1! Found {image_gt.shape}, "
f"{image_pred.shape}."
)

if len(image_gt) == 1 and len(image_pred) == 1:
unique_gt, unique_pred = image_gt[0], image_pred[0]
for gt, pred in zip(unique_gt, unique_pred):
distances.append(np.linalg.norm(gt[:2] - pred[:2]))
scores.append(pred[2])
num_unique = unique_gt.shape[0]
unique_cutoffs = pcutoff
if not isinstance(pcutoff, float):
unique_cutoffs = pcutoff[-num_unique:]

for bpt_index, (gt, pred) in enumerate(zip(unique_gt, unique_pred)):
dist = np.linalg.norm(gt[:2] - pred[:2])
distances.append(dist)

score = pred[2]
if isinstance(pcutoff, float):
bpt_pcutoff = unique_cutoffs
else:
bpt_pcutoff = unique_cutoffs[bpt_index]

if score >= bpt_pcutoff:
distances_cutoff.append(dist)

rmse, rmse_cutoff = float("nan"), float("nan")
if len(distances) == 0:
Expand All @@ -381,10 +416,10 @@ def compute_detection_rmse(
if np.any(~np.isnan(distances)):
rmse = float(np.nanmean(distances).item())

keypoint_scores = np.stack(scores)
pixel_errors_cutoff = distances[keypoint_scores >= pcutoff]
if np.any(~np.isnan(pixel_errors_cutoff)):
rmse_cutoff = float(np.nanmean(pixel_errors_cutoff).item())
if len(distances_cutoff) > 0:
distances_cutoff = np.stack(distances_cutoff)
if np.any(~np.isnan(distances_cutoff)):
rmse_cutoff = float(np.nanmean(distances_cutoff).item())

return rmse, rmse_cutoff

Expand Down
Loading
Loading