Skip to content

Instantly share code, notes, and snippets.

@Paulescu
Created March 15, 2022 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Paulescu/c149efed44c4d7213d916e7878b48794 to your computer and use it in GitHub Desktop.
Save Paulescu/c149efed44c4d7213d916e7878b48794 to your computer and use it in GitHub Desktop.
@st.cache
def fetch_image(url):
response = requests.get(url)
x = Image.open(io.BytesIO(response.content))
x = inverse_preprocess(preprocess(x))
return x
img = fetch_image(url)
@st.cache
def load_model_():
return load_model()
model = load_model_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment