lemonaddie
commited on
Commit
•
7b0c384
1
Parent(s):
a4cfff6
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,30 @@ from gradio_imageslider import ImageSlider
|
|
13 |
|
14 |
import spaces
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
@spaces.GPU
|
17 |
def depth_normal(img):
|
18 |
|
@@ -286,29 +310,7 @@ def depth_normal(img):
|
|
286 |
|
287 |
def main():
|
288 |
|
289 |
-
|
290 |
-
CHECKPOINT = "lemonaddie/Geowizard"
|
291 |
-
REPO_DIR = "geowizard"
|
292 |
-
|
293 |
-
if os.path.isdir(REPO_DIR):
|
294 |
-
shutil.rmtree(REPO_DIR)
|
295 |
-
|
296 |
-
repo = git.Repo.clone_from(REPO_URL, REPO_DIR)
|
297 |
-
sys.path.append(os.path.join(os.getcwd(), REPO_DIR))
|
298 |
-
|
299 |
-
from pipeline.depth_normal_pipeline_clip_cfg import DepthNormalEstimationPipeline
|
300 |
-
|
301 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
302 |
-
pipe = DepthNormalEstimationPipeline.from_pretrained(CHECKPOINT)
|
303 |
-
|
304 |
-
try:
|
305 |
-
import xformers
|
306 |
-
pipe.enable_xformers_memory_efficient_attention()
|
307 |
-
except:
|
308 |
-
pass # run without xformers
|
309 |
-
|
310 |
-
pipe = pipe.to(device)
|
311 |
-
#run_demo_server(pipe)
|
312 |
|
313 |
title = "Geowizard"
|
314 |
description = "Gradio demo for Geowizard."
|
|
|
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):
|
42 |
|
|
|
310 |
|
311 |
def main():
|
312 |
|
313 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
title = "Geowizard"
|
316 |
description = "Gradio demo for Geowizard."
|