CharlieAmalet commited on
Commit
35a1d41
·
verified ·
1 Parent(s): c036eba

Update depth.py

Browse files
Files changed (1) hide show
  1. depth.py +2 -0
depth.py CHANGED
@@ -1,6 +1,7 @@
1
  from zoedepth.utils.misc import colorize, save_raw_16bit
2
  import torch
3
  import gradio as gr
 
4
  from PIL import Image
5
  import numpy as np
6
  from functools import partial
@@ -24,6 +25,7 @@ def process_image(model, image: Image.Image):
24
  processed_array = save_raw_16bit(colorize(out)[:, :, 0])
25
  return Image.fromarray(processed_array)
26
 
 
27
  def depth_interface(model, device):
28
  with gr.Row():
29
  inputs=gr.Image(label="Input Image", type='pil') # Input is an image
 
1
  from zoedepth.utils.misc import colorize, save_raw_16bit
2
  import torch
3
  import gradio as gr
4
+ import spaces
5
  from PIL import Image
6
  import numpy as np
7
  from functools import partial
 
25
  processed_array = save_raw_16bit(colorize(out)[:, :, 0])
26
  return Image.fromarray(processed_array)
27
 
28
+ @spaces.GPU
29
  def depth_interface(model, device):
30
  with gr.Row():
31
  inputs=gr.Image(label="Input Image", type='pil') # Input is an image