Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant jobs created in task when segment_size is explicitly set #7675

Closed
2 tasks done
SpecLad opened this issue Mar 25, 2024 · 0 comments · Fixed by #7681
Closed
2 tasks done

Redundant jobs created in task when segment_size is explicitly set #7675

SpecLad opened this issue Mar 25, 2024 · 0 comments · Fixed by #7681
Labels
bug Something isn't working

Comments

@SpecLad
Copy link
Contributor

SpecLad commented Mar 25, 2024

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

Create a task with the following parameters:

This creates two jobs: one with frames 0-738, another with frames 734-738. The second job is completely redundant, since all frames in it are also in the first job.

Expected Behavior

Only the first job should be created.

Possible Solution

No response

Context

This happens if you already have a video task that was created without explicitly specifying a segment size, and you try to create a new task programmatically by copying parameters from the old task.

Environment

Reproduced with commit eb5b6126.
@SpecLad SpecLad added the bug Something isn't working label Mar 25, 2024
SpecLad added a commit that referenced this issue Mar 26, 2024
1. When a task has non-zero overlap and exactly as many frames as needed
   to create 1 or more complete segments, the current algorithm generates a
   redundant segment at the end. For example, if size is 5, segment size is
   3, and overlap is 1, it generates segments (0, 2), (2, 4), and (4, 4).

   The algorithm attempts to compensate for this, but it only works in the
   case where the segment size is unspecified (and defaults to the total
   size).

   Update the algorithm to handle this correctly in the general case.

2. The algorithm selects a default overlap size of 5 if the media file
   is a video. However, this might not be a valid value if the task has a
   very small segment size. In this case, a range of undesirable behaviors
   may occur, depending on the segment size:

   * segments getting generated such that more than 2 segments cover a
     single frame;

   * task creation crashing with an exception;

   * a task being created with no segments at all.

   Fix this by clamping the default overlap size the same way as a
   user-specified one.

Fixes #7675.
g-kartik pushed a commit to g-kartik/cvat that referenced this issue Mar 29, 2024
1. When a task has non-zero overlap and exactly as many frames as needed
   to create 1 or more complete segments, the current algorithm generates a
   redundant segment at the end. For example, if size is 5, segment size is
   3, and overlap is 1, it generates segments (0, 2), (2, 4), and (4, 4).

   The algorithm attempts to compensate for this, but it only works in the
   case where the segment size is unspecified (and defaults to the total
   size).

   Update the algorithm to handle this correctly in the general case.

2. The algorithm selects a default overlap size of 5 if the media file
   is a video. However, this might not be a valid value if the task has a
   very small segment size. In this case, a range of undesirable behaviors
   may occur, depending on the segment size:

   * segments getting generated such that more than 2 segments cover a
     single frame;

   * task creation crashing with an exception;

   * a task being created with no segments at all.

   Fix this by clamping the default overlap size the same way as a
   user-specified one.

Fixes cvat-ai#7675.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant