lemonaddie commited on
Commit
7bcbc69
1 Parent(s): 7c87a5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -13,29 +13,29 @@ from gradio_imageslider import ImageSlider
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):
 
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):