Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,9 @@ from PIL import Image
|
|
7 |
import tensorflow as tf
|
8 |
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
10 |
-
# Load model directly
|
11 |
-
from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
|
12 |
|
13 |
-
feature_extractor =
|
14 |
-
model =
|
15 |
|
16 |
def ade_palette():
|
17 |
"""ADE20K palette that maps each class to RGB values."""
|
|
|
7 |
import tensorflow as tf
|
8 |
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
|
|
|
|
10 |
|
11 |
+
feature_extractor = SegformerFeatureExtractorExtractor.from_pretrained("prem-timsina/segformer-b0-finetuned-food")
|
12 |
+
model = TFSegformerForSemanticSegmentation.from_pretrained("prem-timsina/segformer-b0-finetuned-food")
|
13 |
|
14 |
def ade_palette():
|
15 |
"""ADE20K palette that maps each class to RGB values."""
|