Spaces:
Runtime error
Runtime error
shyamgupta196
commited on
Commit
·
f1b8e7f
1
Parent(s):
5d9a784
made a mistake earlier now made for semantic segmentation
Browse files
app.py
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
-
from transformers import
|
2 |
from PIL import Image
|
3 |
import requests
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
-
|
8 |
-
|
9 |
def seg(image):
|
10 |
-
feature_extractor =
|
11 |
-
model =
|
12 |
print(model)
|
13 |
|
14 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
|
|
1 |
+
from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
|
2 |
from PIL import Image
|
3 |
import requests
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
7 |
def seg(image):
|
8 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("nvidia/mit-b0")
|
9 |
+
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/mit-b0")
|
10 |
print(model)
|
11 |
|
12 |
inputs = feature_extractor(images=image, return_tensors="pt")
|