Skip to content

Add ctd integration test - #3040

Closed
maximpavliv wants to merge 44 commits into
mainfrom
maxim/add_ctd_integration_test
Closed

Add ctd integration test#3040
maximpavliv wants to merge 44 commits into
mainfrom
maxim/add_ctd_integration_test

Conversation

@maximpavliv

Copy link
Copy Markdown
Contributor

This pull request adds a CTD model to the integration-tested models in examples/testscript_pytorch_multi_animal.py .

To pass the test successfully, a few fixes have been done to the CTD pipeline:

  • When loading conditions from an existing .pickle file, the _assemblies.pickle file is read (instead of the _full.pickle)
  • The CondFromFile.load_conditions_pickle() method is fixed (was not picking the conditions for the last frame)
  • A fix is added to the FilterLowConfidencePoses Preprocessor stage (introduced in Improve CTD preprocessors pipeline #2984), which was failing when the BU was making no keypoints predictions for a frame.
  • The create_video_with_all_detections() method is fixed (previously was assuming that if predictions contained a "bboxes" key they also contained a "bbox_scores" key - this is not the case with CTD models. Similar case fixed in Fix deeplabcut.analyze_images() with CTD model #2990).
  • The PadOutputs Postprocessor stage is made more robust:
    • All outputs are now normalized to np.ndarray (previously, inputs that didn't need padding were not converted to np.ndarray)
    • The PadOutputs now takes an additional expected_shapes argument at __init__(), which it uses to pad correctly empty input arrays.

@maximpavliv maximpavliv added the CTD Contidional Top-Down label Jul 1, 2025
@AlexEMG

AlexEMG commented Jul 2, 2025

Copy link
Copy Markdown
Member

Let's also address #3001 here.

@AlexEMG

AlexEMG commented Jul 12, 2025

Copy link
Copy Markdown
Member

Can you make the tests pass?

@maximpavliv

Copy link
Copy Markdown
Contributor Author

Can you make the tests pass?

@AlexEMG The tests failure was caused by the current superanimal_humanbody integration in main.
I now merged #3066 into this PR and the tests pass

@maximpavliv
maximpavliv requested a review from AlexEMG July 31, 2025 13:48
Replaced np.max by np.nanmax, to avoid excluding whole pose if some keypoint is Nan
@maximpavliv

maximpavliv commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

Let's also address #3001 here.

@AlexEMG , my latest commit should hopefully solve issue #3001 (it solves a very similar case on my machine, we will need to ask the user to confirm it also solves theirs).

[Edit:] the bug raised in #3001 still happens when the FilterLowConfidencePoses processing stage filters out all conditions. I opened a separate Pull Request, which should fix this in all cases.

@maximpavliv

Copy link
Copy Markdown
Contributor Author

This PR no longer has any diffs against main because its commits were included in #3076. Closing as redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CTD Contidional Top-Down DLC3.0🔥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants