yuragoithf commited on
Commit
b6ef95c
·
1 Parent(s): 905f062

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -12,19 +12,13 @@ headers = {"Authorization": f'Bearer {SECRET_TOKEN}'}
12
  estimator = pipeline("depth-estimation")
13
 
14
  def rb(img):
15
- # initialiaze io to_bytes converter
16
- img_byte_arr = io.BytesIO()
17
- # define quality of saved array
18
- img.save(img_byte_arr, format='JPEG', subsampling=0, quality=100)
19
- # converts image array to bytesarray
20
- img_byte_arr = img_byte_arr.getvalue()
21
- result = estimator(img_byte_arr)
22
  return result
23
 
24
 
25
  inputs = gr.inputs.Image(type="pil", label="Upload an image")
26
 
27
 
28
- demo = gr.Interface(fn=rb, inputs=inputs, outputs="json")
29
  #demo = gr.Interface(fn=rb, inputs=inputs, outputs=result["depth"])
30
  demo.launch()
 
12
  estimator = pipeline("depth-estimation")
13
 
14
  def rb(img):
15
+ result = estimator(img)
 
 
 
 
 
 
16
  return result
17
 
18
 
19
  inputs = gr.inputs.Image(type="pil", label="Upload an image")
20
 
21
 
22
+ demo = gr.Interface(fn=estimator, inputs=inputs, outputs="image")
23
  #demo = gr.Interface(fn=rb, inputs=inputs, outputs=result["depth"])
24
  demo.launch()