Spaces:
Runtime error
Runtime error
karolmajek
commited on
Commit
·
f700c84
1
Parent(s):
e6b2315
remove upscale to original res - doesn't work on :hugging: spaces yet
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ feature_extractor = SegformerFeatureExtractor.from_pretrained(model_name)
|
|
25 |
model = SegformerForSemanticSegmentation.from_pretrained(model_name)
|
26 |
|
27 |
def inference(image):
|
28 |
-
|
|
|
29 |
outputs = model(**inputs)
|
30 |
|
31 |
# First, rescale logits to original image size
|
|
|
25 |
model = SegformerForSemanticSegmentation.from_pretrained(model_name)
|
26 |
|
27 |
def inference(image):
|
28 |
+
image = image.resize((1024,1024))
|
29 |
+
inputs = feature_extractor(images=image, return_tensors="pt")
|
30 |
outputs = model(**inputs)
|
31 |
|
32 |
# First, rescale logits to original image size
|