Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import torch
|
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
|
7 |
-
torch.hub.download_url_to_file('http://images.cocodataset.org/val2017/000000039769.jpg', 'cats.jpg')
|
8 |
|
9 |
feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
|
10 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
@@ -34,13 +34,12 @@ def process_image(image):
|
|
34 |
|
35 |
title = "Demo: zero-shot depth estimation with DPT"
|
36 |
description = "Demo for Intel's DPT, a Dense Prediction Transformer for state-of-the-art dense prediction tasks such as semantic segmentation and depth estimation."
|
37 |
-
|
38 |
|
39 |
iface = gr.Interface(fn=process_image,
|
40 |
inputs=gr.inputs.Image(type="pil"),
|
41 |
outputs=gr.outputs.Image(type="pil", label="predicted depth"),
|
42 |
title=title,
|
43 |
description=description,
|
44 |
-
examples=examples,
|
45 |
enable_queue=True)
|
46 |
iface.launch(debug=True)
|
|
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
|
7 |
+
#torch.hub.download_url_to_file('http://images.cocodataset.org/val2017/000000039769.jpg', 'cats.jpg')
|
8 |
|
9 |
feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
|
10 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
|
|
34 |
|
35 |
title = "Demo: zero-shot depth estimation with DPT"
|
36 |
description = "Demo for Intel's DPT, a Dense Prediction Transformer for state-of-the-art dense prediction tasks such as semantic segmentation and depth estimation."
|
37 |
+
|
38 |
|
39 |
iface = gr.Interface(fn=process_image,
|
40 |
inputs=gr.inputs.Image(type="pil"),
|
41 |
outputs=gr.outputs.Image(type="pil", label="predicted depth"),
|
42 |
title=title,
|
43 |
description=description,
|
|
|
44 |
enable_queue=True)
|
45 |
iface.launch(debug=True)
|