Skip to content

Fix destfolder leaking across videos in filter/skeleton loops - #3410

Merged
C-Achard merged 1 commit into
DeepLabCut:external/hwang-misc-fixesfrom
Denny-Hwang:fix/destfolder-per-video
Jul 16, 2026
Merged

Fix destfolder leaking across videos in filter/skeleton loops#3410
C-Achard merged 1 commit into
DeepLabCut:external/hwang-misc-fixesfrom
Denny-Hwang:fix/destfolder-per-video

Conversation

@Denny-Hwang

Copy link
Copy Markdown
Contributor

filterpredictions() and analyzeskeleton() reassigned the destfolder parameter inside their 'for video in Videos' loop when it was None. After the first iteration destfolder stayed pinned to the first video's folder, so videos located in a different folder were looked up in the wrong place: load_analyzed_data raised FileNotFoundError and the video was silently reported as not analyzed (and any output would go to the wrong folder).

Use a per-iteration local 'videofolder' instead of mutating the parameter, matching plot_trajectories and extract_outlier_frames.

filterpredictions() and analyzeskeleton() reassigned the destfolder
parameter inside their 'for video in Videos' loop when it was None.
After the first iteration destfolder stayed pinned to the first
video's folder, so videos located in a different folder were looked
up in the wrong place: load_analyzed_data raised FileNotFoundError
and the video was silently reported as not analyzed (and any output
would go to the wrong folder).

Use a per-iteration local 'videofolder' instead of mutating the
parameter, matching plot_trajectories and extract_outlier_frames.
@C-Achard C-Achard added the bug fix! fix for a real buggy one... label Jul 15, 2026
@deruyter92
deruyter92 force-pushed the fix/destfolder-per-video branch from 6eb31f2 to 05c3e1f Compare July 16, 2026 07:35
@deruyter92

Copy link
Copy Markdown
Collaborator

Ignore the reverted merge with main, I just wanted to check pathlib compatibility, but restored to the original state for easier merging with the neighboring PRs

@C-Achard
C-Achard changed the base branch from main to external/hwang-misc-fixes July 16, 2026 07:42
@C-Achard
C-Achard merged commit f726fb7 into DeepLabCut:external/hwang-misc-fixes Jul 16, 2026
37 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix! fix for a real buggy one...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants