Update
Browse files- .gitattributes +1 -0
- app.py +17 -0
- cats.jpg +3 -0
- dogs.jpg +3 -0
- requirements.txt +4 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import PIL.Image
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
pipe = pipeline('depth-estimation', model='Intel/dpt-large')
|
6 |
+
|
7 |
+
|
8 |
+
def run(image: PIL.Image.Image) -> PIL.Image.Image:
|
9 |
+
return pipe(image)['depth']
|
10 |
+
|
11 |
+
|
12 |
+
demo = gr.Interface(fn=run,
|
13 |
+
inputs=gr.Image(type='pil'),
|
14 |
+
outputs='image',
|
15 |
+
title='Depth Estimation',
|
16 |
+
examples=['cats.jpg', 'dogs.jpg'])
|
17 |
+
demo.queue().launch()
|
cats.jpg
ADDED
Git LFS Details
|
dogs.jpg
ADDED
Git LFS Details
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Pillow
|
2 |
+
torch
|
3 |
+
torchvision
|
4 |
+
transformers
|