Commit
·
cad241c
1
Parent(s):
8a50c06
Fix import error by adding EfficientSAM to Python path
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
|
2 |
import os
|
3 |
import subprocess
|
|
|
4 |
import requests
|
5 |
import zipfile
|
6 |
import gradio as gr
|
@@ -25,6 +26,9 @@ if not os.path.exists("weights/sam_vit_h_4b8939.pth"):
|
|
25 |
if not os.path.exists("EfficientSAM"):
|
26 |
subprocess.run(["git", "clone", "https://github.com/yformer/EfficientSAM.git"])
|
27 |
|
|
|
|
|
|
|
28 |
# Install dependencies
|
29 |
subprocess.run(["pip", "install", "git+https://github.com/facebookresearch/segment-anything.git"])
|
30 |
|
@@ -169,3 +173,4 @@ interface = gr.Interface(
|
|
169 |
|
170 |
interface.launch(debug=True)
|
171 |
|
|
|
|
1 |
|
2 |
import os
|
3 |
import subprocess
|
4 |
+
import sys
|
5 |
import requests
|
6 |
import zipfile
|
7 |
import gradio as gr
|
|
|
26 |
if not os.path.exists("EfficientSAM"):
|
27 |
subprocess.run(["git", "clone", "https://github.com/yformer/EfficientSAM.git"])
|
28 |
|
29 |
+
# Add EfficientSAM to Python path
|
30 |
+
sys.path.append(os.path.abspath("EfficientSAM"))
|
31 |
+
|
32 |
# Install dependencies
|
33 |
subprocess.run(["pip", "install", "git+https://github.com/facebookresearch/segment-anything.git"])
|
34 |
|
|
|
173 |
|
174 |
interface.launch(debug=True)
|
175 |
|
176 |
+
|