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

Lazy load onnx and canvas2html module #7121

Merged
merged 13 commits into from
Jun 7, 2023
Merged

Lazy load onnx and canvas2html module #7121

merged 13 commits into from
Jun 7, 2023

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Jun 5, 2023

I also extracted the html2canvas module since it caught my attention in the bundle analyzer and was simple to extract.

URL of deployed dev instance (used for testing):

Steps to test:

  • open an annotation and the network tab
  • select the quick select tool (onnx module and ml model should be loaded)
  • use the tool
  • hit Q to create a screenshot (html2canvas should be loaded)
  • screenshot should work

Issues:


(Please delete unneeded items, merge only when none are left open)

  • Updated changelog doesn't seem changelog-worthy to me

@philippotto philippotto self-assigned this Jun 5, 2023
@philippotto philippotto marked this pull request as ready for review June 5, 2023 11:41
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Works great 🎉

Tangential, but during testing I noticed that triggering the screenshot functionality, leads to all sorts of css, svg, woff files to be redownloaded for every single screenshot (also happens on master!). Do you understand why this is? I understand that the logo-screenshot.svg is downloaded, but what about all the other files 🤔

network_tab

@philippotto
Copy link
Member Author

Tangential, but during testing I noticed that triggering the screenshot functionality, leads to all sorts of css, svg, woff files to be redownloaded for every single screenshot (also happens on master!). Do you understand why this is? I understand that the logo-screenshot.svg is downloaded, but what about all the other files thinking

html2canvas seems to copy the document into an iframe to be able to do the export. Apparently, this means that these resources are loaded again (however, if "disable cache" is not enabled, the resources are directly served from cache for me). So, I guess, we can't do much about it 🤔

@philippotto philippotto enabled auto-merge (squash) June 7, 2023 10:15
@daniel-wer
Copy link
Member

html2canvas seems to copy the document into an iframe to be able to do the export. Apparently, this means that these resources are loaded again (however, if "disable cache" is not enabled, the resources are directly served from cache for me). So, I guess, we can't do much about it thinking

Ah, that makes sense, thanks for investigating! I agree, that there's no need to do anything about it.

@philippotto philippotto merged commit 9ec8b93 into master Jun 7, 2023
@philippotto philippotto deleted the lazy-onnx branch June 7, 2023 10:33
hotzenklotz added a commit that referenced this pull request Jun 8, 2023
…esign-right-sidebar

* 'master' of github.com:scalableminds/webknossos:
  Create bounding box by dragging with box tool (#7118)
  Prevent 'negative' buckets from being created (#7124)
  Lazy load onnx and canvas2html module (#7121)
  Disable editing of super voxel skeletons in skeleton mode (#7086)
  add missing evolution to migration guide (#7126)
  Change sttp backend to HttpURLConnectionBackend (#7125)
  Implement Zarr v3 and sharding codec (#7079)
  Fix decompression of garbage data after valid gzip data causing decompression to fail (#7119)
  When scanning volume buckets, skip those with unparseable key (#7115)
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.

Lazy-load onnx runtime
2 participants