-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix interpolation for outside shapes #3348
Conversation
@@ -472,7 +472,7 @@ def simple_interpolation(shape0, shape1): | |||
for frame in range(shape0["frame"] + 1, shape1["frame"]): | |||
offset = (frame - shape0["frame"]) / distance | |||
points = None | |||
if shape1["outside"]: | |||
if shape0["outside"] and shape1["outside"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirill-sizov , could you please explain the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmanovic, I made this change so that in the case where the shape has the values keyfame = True
and outside = True
, the interpolation still occurs as shown below:
In current develop version this only works in the UI, but when exporting annotations, there is no interpolation between such frames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirill-sizov ,we have 4 cases:
- both frames are inside => usual interpolation
- first frame is inside, second is outside => usual interpolatio
- first frame is outside, second frame is inside => need to return 2 shapes (first, second), no need to interpolate
- first frame is outside, second frame is outside => need to return 2 shapes (first, second), no need to interpolate.
Could you please implement and check if it works as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure, I'll do it.
points = np.asarray(shape0["points"]) | ||
else: | ||
points = interpolate_position(shape0, shape1, offset) | ||
points = interpolate_position(shape0, shape1, offset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirill-sizov , I believe we don't need to interpolate if the first shape has outside=True.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmanovic, yes, you're right, but this case is handled earlier before calling the interpolate function, here:
https://github.com/openvinotoolkit/cvat/blob/e76b0ea5fc31509b0462694ddfd6bbc982492168/cvat/apps/dataset_manager/annotation.py#L733-L734
Motivation and context
Resolved #3300, resolved #2604.
How has this been tested?
Checklist
develop
branchI have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.