File size: 458 Bytes
b3b1be4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import gradio as gr
import PIL.Image
from transformers import pipeline
pipe = pipeline('depth-estimation', model='Intel/dpt-large')
def run(image: PIL.Image.Image) -> PIL.Image.Image:
return pipe(image)['depth']
demo = gr.Interface(fn=run,
inputs=gr.Image(type='pil'),
outputs='image',
title='Depth Estimation',
examples=['cats.jpg', 'dogs.jpg'])
demo.queue().launch()
|