-
Notifications
You must be signed in to change notification settings - Fork 18
Resolve LabelBOT for tiled images #1232 #1313
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
base: master
Are you sure you want to change the base?
Conversation
|
@mzur Dann geht zwar meine History (5 commits -> 1 commit) verloren, aber das ist nicht so schlimm denke ich. Passt das so? Dann mach ich das morgen und dann kann die PR auch reviewed werden. |
|
Ja das passt so, kein Problem 👍 |
|
btw this is our commit message style guide in case you are interested: https://chris.beams.io/git-commit |
Since tiled images are transmitted in parts, no underlying image can be directly accessed. Instead, a screenshot of the map is taken and cropped according to the selection.
|
@mzur I changed the PR to ready for review, but can't select a reviewer or request a review. It's ready though. |
|
Please resolve the linter errors. Run it locally with |
|
I resolved them, but the pipeline doesn't seem to run automatically @mzur |
mzur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works great already! My comments are mostly about stylistic issues.
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas.vue
Outdated
Show resolved
Hide resolved
Removed unneeded constructs for the labelbot images (TILEDIMAGES state, tempCanvas, etc.)
|
I made the changes as requested @mzur, ready for review again. |
mzur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged the current master.
I noticed that there was a slight delay when the labelbotImage is generated. I suggested some optimizations below.
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas/labelBot.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/annotations/components/annotationCanvas.vue
Outdated
Show resolved
Hide resolved
| makeBlob(event.context.canvas).then(blob => { | ||
| resolve(createImageBitmap(blob)); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeBlob and createImageBitmap are quite slow (600-700 ms on my machine). We don't need a blob or an ImageBitmap object, though, and can use the trimmed canvas directly (200 ms on my machine):
| makeBlob(event.context.canvas).then(blob => { | |
| resolve(createImageBitmap(blob)); | |
| }); | |
| resolve(trimCanvas(event.context.canvas)); |
makeBlob can be moved back to the screenshotButton then.
Most of the remaining 200 ms was used by trimCanvas. This can be improved with an early return (see below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this doesn't work because the canvas is shared between the various layers. After the tiledImageLayer had its postrender event, the next layers will write to the same canvas and annotations will be visible on it. This will result in annotations being visible in the canvas sent to labelbot (unless the labelbot code executes first, which it probably won't). Tested it briefly by displaying the canvas after the postrender event and I did see the annotations on it.
However, if the necessary code for getting the relevant section from the canvas is put directly in the postrender callback, it should work since it's synchronous. I'll try that out and get back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the screenshot code into createLabelbotImageFromTiledImage to handle the canvas synchronously directly after the postrender event and now it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! Just let me know when this is ready to review again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already ready. I applied all your suggestions and tested it locally. Everything seems to works fine.
Co-authored-by: Martin Zurowietz <[email protected]>
Co-authored-by: Martin Zurowietz <[email protected]>
Co-authored-by: Martin Zurowietz <[email protected]>
Co-authored-by: Martin Zurowietz <[email protected]>
Co-authored-by: Martin Zurowietz <[email protected]>
Resolves Issue #1232 by taking a screenshot of the map if the image is tiled.