Zevin2023 commited on
Commit
68cea8b
·
1 Parent(s): 8fa1f84

add online demo

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -1,12 +1,9 @@
1
- import argparse
2
- from demo.UI import Main_ui
3
-
 
 
4
  if __name__ == '__main__':
5
- import subprocess
6
- import sys
7
- def run_command(command):
8
- subprocess.check_call([sys.executable, '-m'] + command.split(), shell=False)
9
-
10
  # Install the package in editable mode
11
  run_command("pip install -e .")
12
 
@@ -37,8 +34,6 @@ if __name__ == '__main__':
37
  # Build frontend
38
  run_command("bash scripts/build_frontend.sh")
39
 
40
-
41
-
42
  # Change back to the previous directory
43
  run_command("cd ..")
44
 
@@ -51,7 +46,8 @@ if __name__ == '__main__':
51
  # Download the model checkpoint
52
  run_command("curl -o ./checkpoints/sam_vit_b_01ec64.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth")
53
 
54
-
 
55
 
56
  parser = argparse.ArgumentParser(description='SEAGULL', formatter_class=argparse.RawTextHelpFormatter)
57
  parser.add_argument('--model', help='path to seagull model', default='Zevin2023/SEAGULL-7B')
@@ -59,4 +55,4 @@ if __name__ == '__main__':
59
  args = parser.parse_args()
60
 
61
  demo = Main_ui(args).load_demo()
62
- demo.launch(server_port=7530)
 
1
+ import subprocess
2
+ import sys
3
+ def run_command(command):
4
+ subprocess.check_call([sys.executable, '-m'] + command.split(), shell=False)
5
+
6
  if __name__ == '__main__':
 
 
 
 
 
7
  # Install the package in editable mode
8
  run_command("pip install -e .")
9
 
 
34
  # Build frontend
35
  run_command("bash scripts/build_frontend.sh")
36
 
 
 
37
  # Change back to the previous directory
38
  run_command("cd ..")
39
 
 
46
  # Download the model checkpoint
47
  run_command("curl -o ./checkpoints/sam_vit_b_01ec64.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth")
48
 
49
+ import argparse
50
+ from demo.UI import Main_ui
51
 
52
  parser = argparse.ArgumentParser(description='SEAGULL', formatter_class=argparse.RawTextHelpFormatter)
53
  parser.add_argument('--model', help='path to seagull model', default='Zevin2023/SEAGULL-7B')
 
55
  args = parser.parse_args()
56
 
57
  demo = Main_ui(args).load_demo()
58
+ demo.launch()