Zevin2023 commited on
Commit
0d95aff
·
1 Parent(s): ac00452

add online demo

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -34,11 +34,11 @@ if __name__ == '__main__':
34
  # # Change back to the previous directory
35
  # os.system("cd ..")
36
 
37
- # Install Segment Anything repository from GitHub
38
- os.system("pip install git+https://github.com/facebookresearch/segment-anything.git")
39
-
40
- # Download the model checkpoint
41
- os.system("curl -o ./checkpoints/sam_vit_b_01ec64.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth")
42
 
43
  import argparse
44
  from demo.UI import Main_ui
 
34
  # # Change back to the previous directory
35
  # os.system("cd ..")
36
 
37
+ import subprocess
38
+ import sys
39
+ subprocess.check_call([sys.executable, 'pip', 'install', 'git+https://github.com/facebookresearch/segment-anything.git'])
40
+ subprocess.check_call([sys.executable, 'curl', '-o', './checkpoints/sam_vit_b_01ec64.pth', 'https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth'])
41
+ # os.system("curl -o ./checkpoints/sam_vit_b_01ec64.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth")
42
 
43
  import argparse
44
  from demo.UI import Main_ui