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

Semi-automatic tools enhancements (Stage 0) #3417

Merged
merged 17 commits into from
Jul 20, 2021
Merged

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented Jul 14, 2021

Motivation and context

Resolved #3361
Related #2936
Related #2515

  • Added implicit "Done" button when drawing any polyshapes
  • Improved visibility for removable points
  • Added correct handling of IOG serverless on UI
  • Redesigned approach how AI tools component interacts with cvat-core objects (it makes the implementation easier and makes us free of a couple of issues)

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

@bsekachev bsekachev added the enhancement New feature or request label Jul 14, 2021
@bsekachev bsekachev requested a review from nmanovic as a code owner July 14, 2021 11:34
@bsekachev bsekachev requested a review from azhavoro as a code owner July 15, 2021 07:40
@bsekachev bsekachev changed the title [WIP] Semi-automatic tools enhancements (Stage 0) Semi-automatic tools enhancements (Stage 0) Jul 15, 2021
ActiveChooN
ActiveChooN previously approved these changes Jul 18, 2021
cvat-core/src/ml-model.js Outdated Show resolved Hide resolved
ActiveChooN
ActiveChooN previously approved these changes Jul 20, 2021
klakhov
klakhov previously approved these changes Jul 20, 2021
max(bbox[1] - crop_padding, 0),
min(bbox[2] + crop_padding, image.width - 1),
min(bbox[3] + crop_padding, image.height - 1)
max(bbox[0][0] - crop_padding, 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it unified with some other input parameters? Usually a bounding box is 4 coordinates [x0, y0, x1, y1]. I'm OK with any solution if there is a common ground behind the decision.

Copy link
Contributor

@nmanovic nmanovic Jul 20, 2021

Choose a reason for hiding this comment

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

Also it will be necessary to redeploy the function with the change. Again, I'm fine with that if we have strong reasons to unify different interfaces.

Copy link
Member Author

@bsekachev bsekachev Jul 20, 2021

Choose a reason for hiding this comment

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

Screenshot from 2021-07-20 09-57-18

Done like for pos_points, neg_points.
We anyway need to re-deploy all the functions after adding min_neg_points

@nmanovic
Copy link
Contributor

nmanovic commented Jul 20, 2021

@bsekachev , why did you decide to keep bounding box till the object is finished? Can I resize it? Please look at the interface below. Probably we need something similar without the extra bbox during adding points. What do you think?

img

@bsekachev
Copy link
Member Author

@bsekachev , why did you decide to keep bounding box till the object is finished? Can I resize it? Please look at the interface below. Probably we need something similar without the extra bbox during adding points. What do you think?

You can't resize it. I believe this bounding box does not disturb a user anyhow, maybe it even helps to remember what region was selected initially, but If you want it is removed, it can be done easily.

@nmanovic
Copy link
Contributor

@bsekachev , why did you decide to keep bounding box till the object is finished? Can I resize it? Please look at the interface below. Probably we need something similar without the extra bbox during adding points. What do you think?

You can't resize it. I believe this bounding box does not disturb a user anyhow, maybe it even helps to remember what region was selected initially, but If you want it is removed, it can be done easily.

I like the demo and interface from IOG github page. I will vote to remove the box.

@nmanovic
Copy link
Contributor

@bsekachev , are you going to unify interfaces to remove points with polygons in the future?

@bsekachev bsekachev dismissed stale reviews from klakhov and ActiveChooN via 3763414 July 20, 2021 07:14
@bsekachev
Copy link
Member Author

I like the demo and interface from IOG github page. I will vote to remove the box.

Done.

@bsekachev
Copy link
Member Author

@bsekachev , are you going to unify interfaces to remove points with polygons in the future?

I am not sure they can be unified absolutely the same way because we must have negative points in the first case and we must keep dragging points in the second case. At least I think need to use an additional hotkey.

@@ -7,6 +7,7 @@ metadata:
spec:
framework: pytorch
min_pos_points: 1
min_neg_points: 0
Copy link
Contributor

@nmanovic nmanovic Jul 20, 2021

Choose a reason for hiding this comment

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

It looks like the method can have negative points:

Clicks representations: We use the same clicks representation as DEXTR[46] by centering a 2D Gaussian around
each click, creating two separate heatmaps for foreground
and background clicks. The resulting heatmaps are concatenated with the RGB input image to form a 5-channel
input for the network. Similar to [46], the bounding box is
first relaxed by several pixels to include context, followed
by cropping to focus on the object-of-interest (Figure 2(d)).

Copy link
Contributor

Choose a reason for hiding this comment

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

Although our IOG approach requires only three clicks
to perform segmentation, our framework naturally supports interactive adding of new foreground and background
clicks for further refinement if the user is not satisfied with
the current segmentation output. To achieve this, we append a lightweight branch before the PSP module to accept the two-channel Gaussian heatmaps encoding all the
foreground and background clicks

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, it has in the implementation.
min_neg_poinst: 0 means that method supports negative points, but they are not obligatory.

@nmanovic nmanovic merged commit 330b8a8 into develop Jul 20, 2021
@nmanovic nmanovic deleted the bs/semi_enhancements branch July 20, 2021 09:38
@bsekachev
Copy link
Member Author

bsekachev commented Jul 21, 2021

@TOsmanov @aschernov

Could you please update the documentation a bit?

  1. Need to add a piece of info about "Done" button that works when drawing polyshapes or using interactors
    Screenshot from 2021-07-22 00-25-30 (copy)

  2. If we have documentation about how to remove points when using interactors, it should be updated also (cursor visualization has been updated and the point gets bigger when it is removable).
    Screenshot from 2021-07-22 00-27-07

If you need a sever with these changes, please contact @azhavoro

@aschernov
Copy link
Contributor

@bsekachev We'll update the documentation

@TOsmanov TOsmanov mentioned this pull request Jul 26, 2021
8 tasks
@bsekachev
Copy link
Member Author

@dvkruchinin

Could you please update tests where we create polygons/polylines/points (need to test "Done" button)

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

Successfully merging this pull request may close these issues.

Improve UX for IOG serverless function (start with a bounding box)
5 participants