hayas commited on
Commit
b3b1be4
1 Parent(s): 9c605ed
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. app.py +17 -0
  3. cats.jpg +3 -0
  4. dogs.jpg +3 -0
  5. 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

  • SHA256: 114e83cc896e9df6476fd682c8d0dc8fafb76e8cf1da5f6396280040081ee1ca
  • Pointer size: 131 Bytes
  • Size of remote file: 681 kB
dogs.jpg ADDED

Git LFS Details

  • SHA256: b864930bea5595060c628e4bff1f06078d7d3c767955efdc3a9db94797d87eee
  • Pointer size: 131 Bytes
  • Size of remote file: 314 kB
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Pillow
2
+ torch
3
+ torchvision
4
+ transformers