Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from transformers import DPTFeatureExtractor, DPTForSemanticSegmentation
|
2 |
from PIL import Image
|
3 |
import requests
|
|
|
4 |
|
5 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
6 |
image = Image.open(requests.get(url, stream=True).raw)
|
@@ -11,4 +12,5 @@ model = DPTForSemanticSegmentation.from_pretrained("Intel/dpt-large-ade")
|
|
11 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
12 |
|
13 |
outputs = model(**inputs)
|
14 |
-
logits = outputs.logits
|
|
|
|
1 |
from transformers import DPTFeatureExtractor, DPTForSemanticSegmentation
|
2 |
from PIL import Image
|
3 |
import requests
|
4 |
+
import streamlit as st
|
5 |
|
6 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
7 |
image = Image.open(requests.get(url, stream=True).raw)
|
|
|
12 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
13 |
|
14 |
outputs = model(**inputs)
|
15 |
+
logits = outputs.logits
|
16 |
+
st.json(logits)
|