.....
Browse files
22.jpg
ADDED
33.jpg
ADDED
app.py
CHANGED
@@ -8,10 +8,10 @@ import tensorflow as tf
|
|
8 |
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
10 |
feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
11 |
-
"
|
12 |
)
|
13 |
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
14 |
-
"
|
15 |
)
|
16 |
|
17 |
def ade_palette():
|
@@ -35,6 +35,7 @@ def ade_palette():
|
|
35 |
[64, 64, 0], # Class 15
|
36 |
[64, 0, 64], # Class 16
|
37 |
[0, 64, 64], # Class 17
|
|
|
38 |
|
39 |
]
|
40 |
|
@@ -104,7 +105,7 @@ def sepia(input_img):
|
|
104 |
demo = gr.Interface(fn=sepia,
|
105 |
inputs=gr.Image(shape=(400, 600)),
|
106 |
outputs=['plot'],
|
107 |
-
examples=["
|
108 |
allow_flagging='never')
|
109 |
|
110 |
|
|
|
8 |
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
10 |
feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
11 |
+
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
|
12 |
)
|
13 |
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
14 |
+
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
|
15 |
)
|
16 |
|
17 |
def ade_palette():
|
|
|
35 |
[64, 64, 0], # Class 15
|
36 |
[64, 0, 64], # Class 16
|
37 |
[0, 64, 64], # Class 17
|
38 |
+
[64, 64, 64],
|
39 |
|
40 |
]
|
41 |
|
|
|
105 |
demo = gr.Interface(fn=sepia,
|
106 |
inputs=gr.Image(shape=(400, 600)),
|
107 |
outputs=['plot'],
|
108 |
+
examples=["22.jpg", "33.jpg"],
|
109 |
allow_flagging='never')
|
110 |
|
111 |
|
labels.txt
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
1 |
+
road
|
2 |
+
sidewalk
|
3 |
+
building
|
4 |
+
wall
|
5 |
+
fence
|
6 |
+
pole
|
7 |
+
traffic light
|
8 |
+
traffic sign
|
9 |
+
vegetation
|
10 |
+
terrain
|
11 |
+
sky
|
12 |
+
person
|
13 |
+
rider
|
14 |
+
car
|
15 |
+
truck
|
16 |
+
bus
|
17 |
+
train
|
18 |
+
motorcycle
|
19 |
+
bicycle
|