Open slienceisgolden opened 1 year ago
Hi, I'm not a maintainer but that's what I've discovered: There is a function that should take the role of warmup, but as I understand it's not public and maybe even not working, I've also tried to launch removeBackground() with a 100px image to warmup but there is no way to cancel the job, so it's taking even more time.
The only way I see is to fork the original lib or patch-package (npm lib for patching packages).
You could also create a PR.
Is https://github.com/imgly/background-removal-js/tree/main/packages/web#preloading-assets what is supposed to address this? However i don't see in code any explicit caching https://github.com/imgly/background-removal-js/blob/7dfe80f617e2d2e6d1961ec473898bed4a4ad850/packages/web/src/resource.ts#L5 , @DanielHauschildt is it meant to rely on browser caching assets implicitly? If it was meant to be explicit caching, i can send a PR if i see noticebale performance improvements
I want to preload assets before the user selects the image. How can I do that?
For my 4g connection, waiting for more than a minute is a very long time