Caching of images #4344
-
Hi, the Caching features are very useful for my expensive functions. I also find the What should be the way that users specify caching for URL-sourced images? Should there be caching features in mo.image() itself, or should it be the responsibility of the user to just download the image then wrap it in a cache? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey Tom- glad you are getting use out of caching. Here's a super straight-forward way of doing this: image_cached = mo.cache(mo.image) image_cached("https://upload.wikimedia.org/wikipedia/en/b/b6/Dramatic_Chipmunk.png") Key thing to remember is cache just captures the compute but not outputs. You could also do: with mo.cache("my_image"):
img = mo.image(...)
img Hope that helps! |
Beta Was this translation helpful? Give feedback.
Hey Tom- glad you are getting use out of caching.
Here's a super straight-forward way of doing this:
Key thing to remember is cache just captures the compute but not outputs. You could also do:
Hope that helps!