-
Notifications
You must be signed in to change notification settings - Fork 323
feat: DEV-4081: Implements Magic Wand tool for image segmentation #1119
feat: DEV-4081: Implements Magic Wand tool for image segmentation #1119
Conversation
This PR implements a Magic Wand, making it possible to click in a region of an image a user is doing segmentation labeling on, drag the mouse to dynamically change flood filling tolerance, then release the mouse button to get a new labeled area. It is particularly effective at labeling broad, diffuse, complex edged objects, such as clouds, cloud shadows, snow, etc. in earth observation applications or organic shapes in biomedical applications. In-depth technical overview on how it works at the top of src/tools/MagicWand.js.
|
Opened another PR to track this one more time, making a cleaner git history off of master using |
|
Note that examples/image_magic_wand/annotations/1.json points to a Google Cloud bucket for serving up some example images; before landing this we will want to copy these to your public bucket and change the path. Note that some CORS headers will also have to be set on that bucket in order for the Magic Wand to work from demo images served from it; those changes are documented in the START.md file. |
|
Related feature request: #1118 |
The old bucket was configured under the wrong project, and using https instead of http causes mixed content issues for CORS. Local development is done with http so using that.
This means undo/redo will now work correctly, but will end up creating a new class layer if more magic wanding is done on the current instance.
|
There was a bug related to drawing several magic wand regions, hitting undo, then attempting to magic wand again -- the offscreen performance cache was incorrectly keeping the old undone region around. I've now fixed this bug with the latest commit to this PR. |
|
I've pushed changes to put the Magic Wand behind a feature flag, though I'm still trying to figure out how to configure the Label Studio server to pick up this new flag. Conversation in Slack here: https://label-studio.slack.com/archives/CQ8LYPPJS/p1673472983241769?thread_ts=1671057042.347029&cid=CQ8LYPPJS |
…nt deployment scenarios.
|
I've taken the QA teams input and made the Magic Wand threshold more robust with better UX. Magic Basically, we now calculate the Magic Wand thresholding from the entire screen, not just relative to the image. We also correctly allow you to drag in any direction to get positive or negative thresholding. |
…me tools. The Magic Wand, the Brush, and the Eraser should all retain selection when moving between them, as well as when moving between those tools and the Zoom or Pan tools. This fix allows removing some hacky specific code I added for the Magic Wand for this behavior. Fixes HumanSignal/label-studio#3510.
|
I've changed the paths of example/test images introduced in this PR to point to the Heartex bucket instead of my own. |
Brandon already explained that all issue either addressed or existed before you PR
Erase previously had false, so it should not unselect region in any case. Tools like Selection, Zoom and others should not unselect it as well. So set default to false and added true to DrawingTool mixin.
|
@hlomzik @bmartel Thanks for the review and approval. I'm still working on:
Once that is done, early next week, I'll report back here on this PR and it sounds like we might be able to land it on main? |
Currently tests are failing when image in gallery is switched. These CORS errors can be fixed in separate PR, so had to disable it.
|
Hi, Brad! |
|
@hlomzik How are you running the integration tests? I think it might be sensitive to how its run. For my setup, I first start the Label Studio frontend debug setup with In a true deployment scenario of the integration tests, how are they run? That can give me a pointer to ensure things work for the Magic Wand e2e tests. |
|
FYI I've fixed the S3/CORS integration issue in this PR: #1191 |
|
FYI e2e tests for the selection fixes here: #1192 |
* docs: Magic Wand documentation After LSF PR HumanSignal/label-studio-frontend#1119 by @BradNeuberg * Add missing image * "publicly" spelling
* docs: Magic Wand documentation After LSF PR HumanSignal/label-studio-frontend#1119 by @BradNeuberg * Add missing image * "publicly" spelling
This pull request implements a Magic Wand, making it possible to click in a region of an image a user is doing segmentation labeling on, drag the mouse to dynamically change flood filling tolerance, then release the mouse button to get a new labeled area. It is particularly effective at labeling broad, diffuse, complex edged objects, such as clouds, cloud shadows, snow, etc. in earth observation applications or organic shapes in biomedical applications.
A short video of the tool in action can be seen here: https://www.youtube.com/watch?v=XxjqBx_0-wk
Detailed notes on its implementation can be seen at the top of src/tools/MagicWand.js.