Update app.py
Browse files
app.py
CHANGED
|
@@ -5,40 +5,38 @@ if __name__ == '__main__':
|
|
| 5 |
os.system("pip install -e .")
|
| 6 |
|
| 7 |
# Install NVM (Node Version Manager)
|
| 8 |
-
|
| 9 |
|
| 10 |
# # Source the appropriate shell configuration file
|
| 11 |
-
|
| 12 |
|
| 13 |
# # Install Node.js version 18.16.0
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
-
# os.system("curl -fsSL https://get.pnpm.io/install.sh | sh -")
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 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
|
|
|
|
| 5 |
os.system("pip install -e .")
|
| 6 |
|
| 7 |
# Install NVM (Node Version Manager)
|
| 8 |
+
os.system("curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash")
|
| 9 |
|
| 10 |
# # Source the appropriate shell configuration file
|
| 11 |
+
os.system("source ~/.bashrc") # You can change to ~/.zshrc based on your shell
|
| 12 |
|
| 13 |
# # Install Node.js version 18.16.0
|
| 14 |
+
os.system("nvm install v18.16.0")
|
| 15 |
|
| 16 |
+
print("nvm installed OK.")
|
|
|
|
| 17 |
|
| 18 |
+
# Install pnpm (package manager)
|
| 19 |
+
os.system("curl -fsSL https://get.pnpm.io/install.sh | sh -")
|
| 20 |
|
| 21 |
+
# Source the shell configuration file again (for pnpm)
|
| 22 |
+
os.system("source ~/.bashrc") # You can change to ~/.zshrc based on your shell
|
| 23 |
|
| 24 |
+
# Verify if pnpm was installed correctly
|
| 25 |
+
os.system("pnpm --version")
|
| 26 |
+
|
| 27 |
+
print("pnpm installed OK.")
|
| 28 |
|
| 29 |
+
# Clone the Gradio BBox repository
|
| 30 |
+
os.system("git clone https://github.com/chencn2020/gradio-bbox.git")
|
| 31 |
|
| 32 |
+
# Change into the cloned repository directory
|
| 33 |
+
os.system("cd gradio-bbox")
|
| 34 |
|
| 35 |
+
# Build frontend
|
| 36 |
+
os.system("bash scripts/build_frontend.sh")
|
| 37 |
|
| 38 |
+
# Change back to the previous directory
|
| 39 |
+
os.system("cd ..")
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
import argparse
|
| 42 |
from demo.UI import Main_ui
|