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

Added rotated bounding boxes #3832

Merged
merged 50 commits into from
Nov 18, 2021
Merged

Added rotated bounding boxes #3832

merged 50 commits into from
Nov 18, 2021

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented Oct 27, 2021

Motivation and context

Resolved #1128

How has this been tested?

Manual testing

TODO:

  • Add a couple of jest tests
  • Add angle visualization
  • Fix migrations
  • Add default values in bindings
  • Add exporting as polygons (in case of mask), add exporting additional attribute in other cases

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

@bsekachev bsekachev changed the title [WIP] Added rotated bounding boxes Added rotated bounding boxes Oct 29, 2021
@bsekachev
Copy link
Member Author

@ActiveChooN @zhiltsov-max Could you please review this patch?

@nmanovic
Copy link
Contributor

@bsekachev , somewhere the precision is lost. Always N.0 is dumped like 72.0 even if in UI I see 71.6

@nmanovic
Copy link
Contributor

@bsekachev , for tracked boxes I see the same problem. All boxes has integer coordinates indeed.

@nmanovic
Copy link
Contributor

@bsekachev , also I tried to set the angle to 'zero'. It is just impossible. Need to redraw. Need to be able set a presice angle somehow. It can be important for angles like 0, 45, 90, ...

@bsekachev
Copy link
Member Author

also I tried to set the angle to 'zero'. It is just impossible.

@nmanovic
I can try implementing the techique with Shift as I suggested before.

@nmanovic
Copy link
Contributor

also I tried to set the angle to 'zero'. It is just impossible.

@nmanovic I can try implementing the techique with Shift as I suggested before.

Please implement a standard option for a popular graphical editor. I believe if rotation isn't 0, it should be displayed as an attribute on the side panel as well. At least for occluded we have a button.

@bsekachev
Copy link
Member Author

@nmanovic

Fixed precision.
Implemented snapped rotation (with Shift step is 15 degrees). It is common approach (i.e. Photoshop).

I believe if rotation isn't 0, it should be displayed as an attribute on the side panel as well

I believe on the side panel this information is totally useless (we don't display there x,y,height,width. Isn't it?
For occluded we have a button because there is no other way to switch it.

@nmanovic
Copy link
Contributor

@nmanovic

Fixed precision. Implemented snapped rotation (with Shift step is 15 degrees). It is common approach (i.e. Photoshop).

I believe if rotation isn't 0, it should be displayed as an attribute on the side panel as well

I believe on the side panel this information is totally useless (we don't display there x,y,height,width. Isn't it? For occluded we have a button because there is no other way to switch it.

I'm fine with the solution if it allows me to set precisely at least 0, 15, ... after I have rotated a box. Occluded and outside properties have corresponding shortcuts. In general it is really a good idea to have a "visual" way to setup an angle. The visual element should have a hint how to do the action using shortcuts. Also rotation is implemented as an attribute thus it is one more reason to have it on the side panel. Just believe me that it isn't useless. But I'm OK to way a feedback from our users before implementing that. It is up to you. Make a decision by yourself.

@MaxPRon MaxPRon mentioned this pull request Nov 18, 2021
@@ -670,6 +670,7 @@ class ShapeSerializer(serializers.Serializer):
type = serializers.ChoiceField(choices=models.ShapeType.choices())
occluded = serializers.BooleanField()
z_order = serializers.IntegerField(default=0)
rotation = serializers.FloatField(default=0, min_value=0, max_value=360)
Copy link
Contributor

Choose a reason for hiding this comment

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

@bsekachev , Is 360 a valid value?

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

LGTM

@nmanovic nmanovic merged commit 7bab58e into develop Nov 18, 2021
@nmanovic nmanovic deleted the bs/rotated_boxes branch November 18, 2021 16:28
@bsekachev
Copy link
Member Author

@aschernov @TOsmanov

Could you please update documentation when the patch is available for you on the internal server?

@dvkruchinin

Could you please prepare some tests to cover the new code and features?

  • Check that bounding boxes can be rotated
  • Check interpolation, merging/splitting rotated shapes
  • Check rotation with hold Shift button

@TOsmanov
Copy link
Contributor

@aschernov @TOsmanov

Could you please update documentation when the patch is available for you on the internal server?

@bsekachev, Yes, sure

@dvkruchinin
Copy link
Contributor

@dvkruchinin

Could you please prepare some tests to cover the new code and features?

  • Check that bounding boxes can be rotated
  • Check interpolation, merging/splitting rotated shapes
  • Check rotation with hold Shift button

@bsekachev
Sure. Tests will be prepared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotated bounding boxes
7 participants