lemonaddie
commited on
Commit
•
7bcbc69
1
Parent(s):
7c87a5e
Update app.py
Browse files
app.py
CHANGED
@@ -13,29 +13,29 @@ from gradio_imageslider import ImageSlider
|
|
13 |
|
14 |
import spaces
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
@spaces.GPU
|
41 |
def depth_normal(img):
|
|
|
13 |
|
14 |
import spaces
|
15 |
|
16 |
+
REPO_URL = "https://github.com/lemonaddie/geowizard.git"
|
17 |
+
CHECKPOINT = "lemonaddie/Geowizard"
|
18 |
+
REPO_DIR = "geowizard"
|
19 |
|
20 |
+
if os.path.isdir(REPO_DIR):
|
21 |
+
shutil.rmtree(REPO_DIR)
|
22 |
|
23 |
+
repo = git.Repo.clone_from(REPO_URL, REPO_DIR)
|
24 |
+
sys.path.append(os.path.join(os.getcwd(), REPO_DIR))
|
25 |
|
26 |
+
from pipeline.depth_normal_pipeline_clip_cfg import DepthNormalEstimationPipeline
|
27 |
|
28 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
29 |
+
pipe = DepthNormalEstimationPipeline.from_pretrained(CHECKPOINT)
|
30 |
|
31 |
+
try:
|
32 |
+
import xformers
|
33 |
+
pipe.enable_xformers_memory_efficient_attention()
|
34 |
+
except:
|
35 |
+
pass # run without xformers
|
36 |
+
|
37 |
+
pipe = pipe.to(device)
|
38 |
+
#run_demo_server(pipe)
|
39 |
|
40 |
@spaces.GPU
|
41 |
def depth_normal(img):
|