Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,19 @@ from PIL import Image
|
|
6 |
import gradio as gr
|
7 |
import requests
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# ---------------------------
|
10 |
# Download helper
|
11 |
# ---------------------------
|
|
|
6 |
import gradio as gr
|
7 |
import requests
|
8 |
|
9 |
+
import os
|
10 |
+
import sys
|
11 |
+
import subprocess
|
12 |
+
|
13 |
+
# Clone the repo manually at runtime
|
14 |
+
if not os.path.exists("Grounded-Segment-Anything"):
|
15 |
+
subprocess.run(["git", "clone", "--recurse-submodules", "https://github.com/IDEA-Research/Grounded-Segment-Anything.git"])
|
16 |
+
|
17 |
+
# Add submodules to path
|
18 |
+
sys.path.append("Grounded-Segment-Anything/GroundingDINO")
|
19 |
+
sys.path.append("Grounded-Segment-Anything/segment_anything")
|
20 |
+
|
21 |
+
|
22 |
# ---------------------------
|
23 |
# Download helper
|
24 |
# ---------------------------
|