-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/bitmask #249
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
Merged
Merged
Feature/bitmask #249
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
076e0d1
intial test of bitmask mode
TrevorBurgoyne fe18c1c
fix bugs with class and moves
TrevorBurgoyne 77771c5
fix brush
TrevorBurgoyne bfc86d3
initial changelog
TrevorBurgoyne 04957d0
add exclude/overwrite brush modes
TrevorBurgoyne 2da6081
fix bitmask to properly overwrite when drawing with a new class
TrevorBurgoyne 99b8923
fix brush keybinds, update tooltips and changelog
TrevorBurgoyne 2f02027
add bitmask save/load test
TrevorBurgoyne f360a53
fix comments from review, rle validation on load and better redraw pe…
TrevorBurgoyne e7a8c8c
handle bitmask in delete modes
TrevorBurgoyne 11715f0
refactor brush mode localstorage
TrevorBurgoyne 7aef03a
add bitmask to live demo
TrevorBurgoyne f6fa160
add demo bitmask resume from
TrevorBurgoyne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,12 @@ | ||
| ## Tasks | ||
|
|
||
| ### Bitmask segmentation annotation mode | ||
| Per-annotation binary masks, COCO-style RLE serialization, brush + erase interaction. | ||
|
|
||
| - [x] Phase 1: Data model + RLE utils + tests (`src/mask_utils.ts`, `ULabelSpatialType`, `SPATIAL_TYPE_SET`) | ||
| - [x] Phase 2: Bitmask rendering layer (`draw_bitmask`, dispatch, redraw/clear) | ||
| - [x] Phase 3: Brush/erase paints pixels (begin/continue/finish for bitmask) | ||
| - [x] Phase 4: Undo/redo patch diffs for brush strokes (single-stroke `bitmask_stroke` action) | ||
| - [x] Phase 5: Toolbox + mode registration (mode button, brush enable/disable, keybinds) | ||
| - [ ] Phase 6: Export/import round-trip + tests + demo page | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>ULabel - Bitmask Segmentation</title> | ||
|
|
||
| <!-- ULabel Library --> | ||
| <script src="/ulabel.js"></script> | ||
|
|
||
| <!-- JQuery Library --> | ||
| <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | ||
|
|
||
| <!-- ULabel Usage --> | ||
| <script> | ||
| /* global $ */ | ||
| /* global ULabel */ | ||
|
|
||
| $(window).on("load", function() { | ||
|
|
||
| function on_submit(annotations) { | ||
| var element = document.createElement('a'); | ||
| element.setAttribute( | ||
| "href", ('data:text/plain;charset=utf-8,' + | ||
| encodeURIComponent(JSON.stringify(annotations, null, 2))) | ||
| ); | ||
| element.setAttribute("download", "annotations.json"); | ||
| element.style.display = 'none'; | ||
| document.body.appendChild(element); | ||
| element.click(); | ||
| document.body.removeChild(element); | ||
| } | ||
|
|
||
| let subtasks = { | ||
| "segmentation": { | ||
| "display_name": "Segmentation", | ||
| "classes": [ | ||
| { | ||
| "name": "Vehicle", | ||
| "color": "orange", | ||
| "id": 10 | ||
| }, | ||
| { | ||
| "name": "Obstacle", | ||
| "color": "green", | ||
| "id": 11 | ||
| } | ||
| ], | ||
| "allowed_modes": ["bitmask", "polygon", "delete_bbox"], | ||
| "resume_from": null, | ||
| "task_meta": null, | ||
| "annotation_meta": null | ||
| } | ||
| }; | ||
|
|
||
| // Initial ULabel configuration | ||
| let ulabel = new ULabel({ | ||
| "container_id": "container", | ||
| "image_data": "https://ulabel.s3.us-east-2.amazonaws.com/cs-demo-0.png", | ||
| "username": "DemoUser", | ||
| "submit_buttons": on_submit, | ||
| "subtasks": subtasks | ||
| }); | ||
| // Wait for ULabel instance to finish initialization | ||
| ulabel.init(function() { | ||
| // ULabel is now ready for use | ||
| }); | ||
|
|
||
| }); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <div id="container" style="width: 100%; height: 100vh; position: absolute; top: 0; left: 0;"></div> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.