ZenosArrows commited on
Commit
150ce55
·
verified ·
1 Parent(s): 30a56a9

Add @spaces.GPU decorations

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -86,6 +86,7 @@ title = "# Depth Anything V2"
86
  description = """Looking Glass demo for **Depth Anything V2**.
87
  Please refer to our [paper](https://arxiv.org/abs/2406.09414), [project page](https://depth-anything-v2.github.io), or [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
88
 
 
89
  def predict_depth(image, model):
90
  w, h = image.size
91
 
@@ -101,6 +102,7 @@ def predict_depth(image, model):
101
  rgbd.paste(gray_depth, (w, 0))
102
  return rgbd
103
 
 
104
  def upscale_image(image, model, background, discard_alpha):
105
  if image.mode == "RGBA":
106
  if discard_alpha:
@@ -291,4 +293,4 @@ with gr.Blocks(css=css, head=head) as demo:
291
 
292
 
293
  if __name__ == '__main__':
294
- demo.queue().launch(share=True)
 
86
  description = """Looking Glass demo for **Depth Anything V2**.
87
  Please refer to our [paper](https://arxiv.org/abs/2406.09414), [project page](https://depth-anything-v2.github.io), or [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
88
 
89
+ @spaces.GPU
90
  def predict_depth(image, model):
91
  w, h = image.size
92
 
 
102
  rgbd.paste(gray_depth, (w, 0))
103
  return rgbd
104
 
105
+ @spaces.GPU
106
  def upscale_image(image, model, background, discard_alpha):
107
  if image.mode == "RGBA":
108
  if discard_alpha:
 
293
 
294
 
295
  if __name__ == '__main__':
296
+ demo.queue().launch()