ovshake commited on
Commit
ad35187
1 Parent(s): b802e3b

add caching

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,7 +40,7 @@ class Parts:
40
  UPPER = 1
41
  LOWER = 2
42
 
43
- @st.cache
44
  def load_u2net():
45
  device = "cuda" if torch.cuda.is_available() else "cpu"
46
  checkpoint_path = hf_hub_download(repo_id="maiti/cloth-segmentation", filename="cloth_segm_u2net_latest.pth")
@@ -55,7 +55,7 @@ def change_bg_color(rgba_image, color):
55
  new_image.paste(rgba_image, (0, 0), rgba_image)
56
  return new_image.convert("RGB")
57
 
58
- @st.cache
59
  def load_inpainting_pipeline():
60
  device = "cuda" if torch.cuda.is_available() else "cpu"
61
  inpainting_pipeline = StableDiffusionInpaintPipeline.from_pretrained(
 
40
  UPPER = 1
41
  LOWER = 2
42
 
43
+ @st.cache(allow_output_mutation=True)
44
  def load_u2net():
45
  device = "cuda" if torch.cuda.is_available() else "cpu"
46
  checkpoint_path = hf_hub_download(repo_id="maiti/cloth-segmentation", filename="cloth_segm_u2net_latest.pth")
 
55
  new_image.paste(rgba_image, (0, 0), rgba_image)
56
  return new_image.convert("RGB")
57
 
58
+ @st.cache(allow_output_mutation=True)
59
  def load_inpainting_pipeline():
60
  device = "cuda" if torch.cuda.is_available() else "cpu"
61
  inpainting_pipeline = StableDiffusionInpaintPipeline.from_pretrained(