....
Browse files- ADE_val_00000001.jpeg +0 -0
- ADE_val_00001159.jpg +0 -0
- ADE_val_00001248.jpg +0 -0
- ADE_val_00001472.jpg +0 -0
- app.py +21 -152
- labels.txt +18 -150
ADE_val_00000001.jpeg
DELETED
Binary file (51.8 kB)
|
|
ADE_val_00001159.jpg
DELETED
Binary file (10.8 kB)
|
|
ADE_val_00001248.jpg
DELETED
Binary file (19.5 kB)
|
|
ADE_val_00001472.jpg
DELETED
Binary file (53.3 kB)
|
|
app.py
CHANGED
@@ -8,165 +8,34 @@ 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():
|
18 |
"""ADE20K palette that maps each class to RGB values."""
|
19 |
return [
|
20 |
-
[
|
21 |
-
[
|
22 |
-
[
|
23 |
-
[
|
24 |
-
[
|
25 |
-
[
|
26 |
-
[
|
27 |
-
[
|
28 |
-
[
|
29 |
-
[
|
30 |
-
[
|
31 |
-
[
|
32 |
-
[
|
33 |
-
[
|
34 |
-
[
|
35 |
-
[
|
36 |
-
[
|
37 |
-
[
|
38 |
-
|
39 |
-
[32, 90, 210],
|
40 |
-
[56, 123, 67],
|
41 |
-
[180, 56, 123],
|
42 |
-
[123, 67, 45],
|
43 |
-
[45, 134, 200],
|
44 |
-
[67, 56, 123],
|
45 |
-
[78, 123, 67],
|
46 |
-
[32, 210, 90],
|
47 |
-
[45, 56, 189],
|
48 |
-
[123, 56, 123],
|
49 |
-
[56, 156, 200],
|
50 |
-
[189, 56, 45],
|
51 |
-
[112, 200, 56],
|
52 |
-
[56, 123, 45],
|
53 |
-
[200, 32, 90],
|
54 |
-
[123, 45, 78],
|
55 |
-
[200, 156, 56],
|
56 |
-
[45, 67, 123],
|
57 |
-
[56, 45, 78],
|
58 |
-
[45, 56, 123],
|
59 |
-
[123, 67, 56],
|
60 |
-
[56, 78, 123],
|
61 |
-
[210, 90, 32],
|
62 |
-
[123, 56, 189],
|
63 |
-
[45, 200, 134],
|
64 |
-
[67, 123, 56],
|
65 |
-
[123, 45, 67],
|
66 |
-
[90, 32, 210],
|
67 |
-
[200, 45, 78],
|
68 |
-
[32, 210, 90],
|
69 |
-
[45, 123, 67],
|
70 |
-
[165, 42, 87],
|
71 |
-
[72, 145, 167],
|
72 |
-
[15, 158, 75],
|
73 |
-
[209, 89, 40],
|
74 |
-
[32, 21, 121],
|
75 |
-
[184, 20, 100],
|
76 |
-
[56, 135, 15],
|
77 |
-
[128, 92, 176],
|
78 |
-
[1, 119, 140],
|
79 |
-
[220, 151, 43],
|
80 |
-
[41, 97, 72],
|
81 |
-
[148, 38, 27],
|
82 |
-
[107, 86, 176],
|
83 |
-
[21, 26, 136],
|
84 |
-
[174, 27, 90],
|
85 |
-
[91, 96, 204],
|
86 |
-
[108, 50, 107],
|
87 |
-
[27, 45, 136],
|
88 |
-
[168, 200, 52],
|
89 |
-
[7, 102, 27],
|
90 |
-
[42, 93, 56],
|
91 |
-
[140, 52, 112],
|
92 |
-
[92, 107, 168],
|
93 |
-
[17, 118, 176],
|
94 |
-
[59, 50, 174],
|
95 |
-
[206, 40, 143],
|
96 |
-
[44, 19, 142],
|
97 |
-
[23, 168, 75],
|
98 |
-
[54, 57, 189],
|
99 |
-
[144, 21, 15],
|
100 |
-
[15, 176, 35],
|
101 |
-
[107, 19, 79],
|
102 |
-
[204, 52, 114],
|
103 |
-
[48, 173, 83],
|
104 |
-
[11, 120, 53],
|
105 |
-
[206, 104, 28],
|
106 |
-
[20, 31, 153],
|
107 |
-
[27, 21, 93],
|
108 |
-
[11, 206, 138],
|
109 |
-
[112, 30, 83],
|
110 |
-
[68, 91, 152],
|
111 |
-
[153, 13, 43],
|
112 |
-
[25, 114, 54],
|
113 |
-
[92, 27, 150],
|
114 |
-
[108, 42, 59],
|
115 |
-
[194, 77, 5],
|
116 |
-
[145, 48, 83],
|
117 |
-
[7, 113, 19],
|
118 |
-
[25, 92, 113],
|
119 |
-
[60, 168, 79],
|
120 |
-
[78, 33, 120],
|
121 |
-
[89, 176, 205],
|
122 |
-
[27, 200, 94],
|
123 |
-
[210, 67, 23],
|
124 |
-
[123, 89, 189],
|
125 |
-
[225, 56, 112],
|
126 |
-
[75, 156, 45],
|
127 |
-
[172, 104, 200],
|
128 |
-
[15, 170, 197],
|
129 |
-
[240, 133, 65],
|
130 |
-
[89, 156, 112],
|
131 |
-
[214, 88, 57],
|
132 |
-
[156, 134, 200],
|
133 |
-
[78, 57, 189],
|
134 |
-
[200, 78, 123],
|
135 |
-
[106, 120, 210],
|
136 |
-
[145, 56, 112],
|
137 |
-
[89, 120, 189],
|
138 |
-
[185, 206, 56],
|
139 |
-
[47, 99, 28],
|
140 |
-
[112, 189, 78],
|
141 |
-
[200, 112, 89],
|
142 |
-
[89, 145, 112],
|
143 |
-
[78, 106, 189],
|
144 |
-
[112, 78, 189],
|
145 |
-
[156, 112, 78],
|
146 |
-
[28, 210, 99],
|
147 |
-
[78, 89, 189],
|
148 |
-
[189, 78, 57],
|
149 |
-
[112, 200, 78],
|
150 |
-
[189, 47, 78],
|
151 |
-
[205, 112, 57],
|
152 |
-
[78, 145, 57],
|
153 |
-
[200, 78, 112],
|
154 |
-
[99, 89, 145],
|
155 |
-
[200, 156, 78],
|
156 |
-
[57, 78, 145],
|
157 |
-
[78, 57, 99],
|
158 |
-
[57, 78, 145],
|
159 |
-
[145, 112, 78],
|
160 |
-
[78, 89, 145],
|
161 |
-
[210, 99, 28],
|
162 |
-
[145, 78, 189],
|
163 |
-
[57, 200, 136],
|
164 |
-
[89, 156, 78],
|
165 |
-
[145, 78, 99],
|
166 |
-
[99, 28, 210],
|
167 |
-
[189, 78, 47],
|
168 |
-
[28, 210, 99],
|
169 |
-
[78, 145, 57],
|
170 |
]
|
171 |
|
172 |
labels_list = []
|
|
|
8 |
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
10 |
feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
11 |
+
"mattmdjaga/segformer_b2_clothes"
|
12 |
)
|
13 |
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
14 |
+
"mattmdjaga/segformer_b2_clothes"
|
15 |
)
|
16 |
|
17 |
def ade_palette():
|
18 |
"""ADE20K palette that maps each class to RGB values."""
|
19 |
return [
|
20 |
+
[255, 0, 0], # Class 0
|
21 |
+
[0, 255, 0], # Class 1
|
22 |
+
[0, 0, 255], # Class 2
|
23 |
+
[255, 255, 0], # Class 3
|
24 |
+
[255, 0, 255], # Class 4
|
25 |
+
[0, 255, 255], # Class 5
|
26 |
+
[128, 0, 0], # Class 6
|
27 |
+
[0, 128, 0], # Class 7
|
28 |
+
[0, 0, 128], # Class 8
|
29 |
+
[128, 128, 0], # Class 9
|
30 |
+
[128, 0, 128], # Class 10
|
31 |
+
[0, 128, 128], # Class 11
|
32 |
+
[64, 0, 0], # Class 12
|
33 |
+
[0, 64, 0], # Class 13
|
34 |
+
[0, 0, 64], # Class 14
|
35 |
+
[64, 64, 0], # Class 15
|
36 |
+
[64, 0, 64], # Class 16
|
37 |
+
[0, 64, 64], # Class 17
|
38 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
]
|
40 |
|
41 |
labels_list = []
|
labels.txt
CHANGED
@@ -1,150 +1,18 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
curtain
|
20 |
-
chair
|
21 |
-
car
|
22 |
-
water
|
23 |
-
painting
|
24 |
-
sofa
|
25 |
-
shelf
|
26 |
-
house
|
27 |
-
sea
|
28 |
-
mirror
|
29 |
-
rug
|
30 |
-
field
|
31 |
-
armchair
|
32 |
-
seat
|
33 |
-
fence
|
34 |
-
desk
|
35 |
-
rock
|
36 |
-
wardrobe
|
37 |
-
lamp
|
38 |
-
bathtub
|
39 |
-
railing
|
40 |
-
cushion
|
41 |
-
base
|
42 |
-
box
|
43 |
-
column
|
44 |
-
signboard
|
45 |
-
chest of drawers
|
46 |
-
counter
|
47 |
-
sand
|
48 |
-
sink
|
49 |
-
skyscraper
|
50 |
-
fireplace
|
51 |
-
refrigerator
|
52 |
-
grandstand
|
53 |
-
path
|
54 |
-
stairs
|
55 |
-
runway
|
56 |
-
case
|
57 |
-
pool table
|
58 |
-
pillow
|
59 |
-
screen door
|
60 |
-
stairway
|
61 |
-
river
|
62 |
-
bridge
|
63 |
-
bookcase
|
64 |
-
blind
|
65 |
-
coffee table
|
66 |
-
toilet
|
67 |
-
flower
|
68 |
-
book
|
69 |
-
hill
|
70 |
-
bench
|
71 |
-
countertop
|
72 |
-
stove
|
73 |
-
palm
|
74 |
-
kitchen island
|
75 |
-
computer
|
76 |
-
swivel chair
|
77 |
-
boat
|
78 |
-
bar
|
79 |
-
arcade machine
|
80 |
-
hovel
|
81 |
-
bus
|
82 |
-
towel
|
83 |
-
light
|
84 |
-
truck
|
85 |
-
tower
|
86 |
-
chandelier
|
87 |
-
awning
|
88 |
-
streetlight
|
89 |
-
booth
|
90 |
-
television receiver
|
91 |
-
airplane
|
92 |
-
dirt track
|
93 |
-
apparel
|
94 |
-
pole
|
95 |
-
land
|
96 |
-
bannister
|
97 |
-
escalator
|
98 |
-
ottoman
|
99 |
-
bottle
|
100 |
-
buffet
|
101 |
-
poster
|
102 |
-
stage
|
103 |
-
van
|
104 |
-
ship
|
105 |
-
fountain
|
106 |
-
conveyer belt
|
107 |
-
canopy
|
108 |
-
washer
|
109 |
-
plaything
|
110 |
-
swimming pool
|
111 |
-
stool
|
112 |
-
barrel
|
113 |
-
basket
|
114 |
-
waterfall
|
115 |
-
tent
|
116 |
-
bag
|
117 |
-
minibike
|
118 |
-
cradle
|
119 |
-
oven
|
120 |
-
ball
|
121 |
-
food
|
122 |
-
step
|
123 |
-
tank
|
124 |
-
trade name
|
125 |
-
microwave
|
126 |
-
pot
|
127 |
-
animal
|
128 |
-
bicycle
|
129 |
-
lake
|
130 |
-
dishwasher
|
131 |
-
screen
|
132 |
-
blanket
|
133 |
-
sculpture
|
134 |
-
hood
|
135 |
-
sconce
|
136 |
-
vase
|
137 |
-
traffic light
|
138 |
-
tray
|
139 |
-
ashcan
|
140 |
-
fan
|
141 |
-
pier
|
142 |
-
crt screen
|
143 |
-
plate
|
144 |
-
monitor
|
145 |
-
bulletin board
|
146 |
-
shower
|
147 |
-
radiator
|
148 |
-
glass
|
149 |
-
clock
|
150 |
-
flag
|
|
|
1 |
+
Background
|
2 |
+
Hat
|
3 |
+
Hair
|
4 |
+
Sunglasses
|
5 |
+
Upper-clothes
|
6 |
+
Skirt
|
7 |
+
Pants
|
8 |
+
Dress
|
9 |
+
Belt
|
10 |
+
Left-shoe
|
11 |
+
Right-shoe
|
12 |
+
Face
|
13 |
+
Left-leg
|
14 |
+
Right-leg
|
15 |
+
Left-arm
|
16 |
+
Right-arm
|
17 |
+
Bag
|
18 |
+
Scarf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|