svjack commited on
Commit
3c1aec8
·
verified ·
1 Parent(s): a350cc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -168,7 +168,8 @@ sam_checkpoint_url_dict = {
168
  'vit_l': "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth",
169
  'vit_b': "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth"
170
  }
171
- checkpoint_folder = os.path.join('/home/user/app/', 'pretrained_models')
 
172
 
173
  sam_checkpoint = load_file_from_url(sam_checkpoint_url_dict[args.sam_model_type], checkpoint_folder)
174
  # initialize sams
@@ -239,8 +240,13 @@ html_img = f'''
239
  </div>
240
  '''
241
 
 
 
 
 
242
  tutorial_url = "https://github.com/zjx0101/ObjectClear/releases/download/media/tutorial.mp4"
243
- assets_path = os.path.join('/home/user/app/hugging_face/', "assets/")
 
244
  load_file_from_url(tutorial_url, assets_path)
245
 
246
  description = r"""
@@ -564,4 +570,4 @@ with gr.Blocks(css=custom_css) as demo:
564
  )
565
 
566
 
567
- demo.launch(debug=True, show_error=True)
 
168
  'vit_l': "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth",
169
  'vit_b': "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth"
170
  }
171
+ #checkpoint_folder = os.path.join('/home/user/app/', 'pretrained_models')
172
+ checkpoint_folder = os.path.join('.', 'pretrained_models')
173
 
174
  sam_checkpoint = load_file_from_url(sam_checkpoint_url_dict[args.sam_model_type], checkpoint_folder)
175
  # initialize sams
 
240
  </div>
241
  '''
242
 
243
+ #checkpoint_folder = os.path.join('/home/user/app/', 'pretrained_models')
244
+ #checkpoint_folder = os.path.join('.', 'pretrained_models')
245
+
246
+
247
  tutorial_url = "https://github.com/zjx0101/ObjectClear/releases/download/media/tutorial.mp4"
248
+ #assets_path = os.path.join('/home/user/app/hugging_face/', "assets/")
249
+ assets_path = os.path.join('hugging_face/', "assets/")
250
  load_file_from_url(tutorial_url, assets_path)
251
 
252
  description = r"""
 
570
  )
571
 
572
 
573
+ demo.launch(debug=True, show_error=True, share = True, server_name = "0.0.0.0")