flamehaze1115 commited on
Commit
09e9525
1 Parent(s): c704d5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -66,13 +66,13 @@ class SAMAPI:
66
  predictor = None
67
 
68
  @staticmethod
69
- # @st.cache_resource
70
  def get_instance(sam_checkpoint=None):
71
  if SAMAPI.predictor is None:
72
  if sam_checkpoint is None:
73
- sam_checkpoint = "sam_pt/sam_vit_h_4b8939.pth"
74
  if not os.path.exists(sam_checkpoint):
75
- os.makedirs('sam_pt', exist_ok=True)
76
  urllib.request.urlretrieve(
77
  "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",
78
  sam_checkpoint
 
66
  predictor = None
67
 
68
  @staticmethod
69
+ @st.cache_resource
70
  def get_instance(sam_checkpoint=None):
71
  if SAMAPI.predictor is None:
72
  if sam_checkpoint is None:
73
+ sam_checkpoint = "tmp/sam_vit_h_4b8939.pth"
74
  if not os.path.exists(sam_checkpoint):
75
+ os.makedirs('tmp', exist_ok=True)
76
  urllib.request.urlretrieve(
77
  "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",
78
  sam_checkpoint