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

Fix interpolation for outside shapes #3348

Merged
merged 4 commits into from
Jun 24, 2021

Conversation

sizov-kirill
Copy link
Contributor

@sizov-kirill sizov-kirill commented Jun 21, 2021

Motivation and context

Resolved #3300, resolved #2604.

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@sizov-kirill sizov-kirill changed the title [WIP] Fix interpolation for outside shapes Fix interpolation for outside shapes Jun 21, 2021
@@ -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"]:
Copy link
Contributor

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?

Copy link
Contributor Author

@sizov-kirill sizov-kirill Jun 21, 2021

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:
3300
In current develop version this only works in the UI, but when exporting annotations, there is no interpolation between such frames.

Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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

nmanovic
nmanovic previously approved these changes Jun 24, 2021
@nmanovic nmanovic merged commit 47ea751 into develop Jun 24, 2021
@nmanovic nmanovic deleted the sk/fix_tracking_for_outside_shapes branch June 24, 2021 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants