Skip to content

issues with cropping #3269

Description

@jonpedros

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Windows 11

DeepLabCut version

DLC 3.0.0rc13

What engine are you using?

pytorch

DeepLabCut mode

single animal

Device type

GeForce 5060 RTX

Bug description 🐛

There are several issues with how the code handles video cropping.

First, the handling of crop coordinates is fragmented:

  • extract_frames pulls video-specific coordinates from video_sets in config.yaml, ignoring the cropping: true/false global flag.
  • analyze_videos (via checkcropping in predict_videos.py) ignores video_sets and enforces the global x1, x2, y1, y2 coordinates beneath the global flag.
  • extract_outlier_frames attempts to use video_sets, but only if the global cropping boolean is set to true.

Second, the global flag and the global coordinates are misleading because they make it seem like this cropping flag itself is for a single coordinate cropping option used for all videos.

Third, there is no standalone way in the GUI to define crop coordinates for a new video added to an existing project. The select_cropping_area widget is only used for the "Extract Frames" tab. If a user just wants to analyze a new video and extract outliers, they cannot visually crop it without unnecessarily extracting frames first.

Fourth, because the "Extract Outlier Frames" GUI tab has no cropping toggle, the global flag is used. If it's false, extract_outlier_frames.py assigns coords=None and passes it to attempt_to_add_video(). This wrapper calls add_new_videos(), which grabs full-frame dimensions and updates the cfg["video_sets"] dictionary. This erases any video-specific cropping coordinates the user had previously saved and used to extract frames, etc.

Steps To Reproduce

No response

Relevant log output

Anything else?

No response

Code of Conduct

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions