Skip to content

Conversation

@n-poulsen
Copy link
Contributor

@n-poulsen n-poulsen commented Dec 18, 2023

Addresses issues #2461 and #2463

When running add_new_videos(..., extract_frames=True), the configuration file is written after extract_frames is called. So when getting the videos for which to extract new frames, the new videos are not yet in the project configuration:

    # deeplabcut.extract_frames, lines 269-272
    if videos_list is None:
        videos = cfg.get("video_sets_original") or cfg["video_sets"]
    else:  # filter video_list by the ones in the config file
        videos = [v for v in cfg["video_sets"] if v in videos_list]  # none of videos_list are in cfg["video_sets"] yet!
    ...

    has_failed = []
    for video in videos:
        ...

    if all(has_failed):  # True as the list is empty
        print("Frame extraction failed. Video files must be corrupted.")

Also deals with the case when users pass a single video to add as a string: wraps it in a list to avoid the annoying issue in #2463.

@n-poulsen n-poulsen added the bug fix! fix for a real buggy one... label Dec 18, 2023
Copy link
Member

@MMathisLab MMathisLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@AlexEMG AlexEMG merged commit d3b9f1f into main Dec 19, 2023
@MMathisLab MMathisLab mentioned this pull request Feb 8, 2024
@MMathisLab MMathisLab deleted the niels/extract_frames_bug branch February 11, 2024 17:16
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