akman12914 commited on
Commit
525a9cd
·
1 Parent(s): 95cf289

Structure revise

Browse files
Files changed (12) hide show
  1. app.py +233 -12
  2. config.json +0 -372
  3. image.jpg +0 -0
  4. image_1.jpg +0 -0
  5. image_2.jpg +0 -0
  6. image_3.jpg +0 -0
  7. image_4.jpg +0 -0
  8. labels.txt +150 -0
  9. preprocessor_config.json +0 -18
  10. pytorch_model.bin +0 -3
  11. requirements.txt +5 -1
  12. tf_model.h5 +0 -3
app.py CHANGED
@@ -1,23 +1,244 @@
1
  import gradio as gr
2
 
 
 
 
3
  from PIL import Image
4
- import requests
5
- from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
6
 
7
- feature_extractor = SegformerImageProcessor.from_pretrained(
8
  "nvidia/segformer-b0-finetuned-ade-512-512"
9
  )
10
-
11
- processor = SegformerImageProcessor.from_pretrained(
12
- "nvidia/segformer-b0-finetuned-ade-512-512"
13
  )
14
- model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
17
 
18
- url = "http://images.cocodataset.org/val2017/000000039769.jpg"
19
- image = Image.open(requests.get(url, stream=True).raw)
20
 
21
- inputs = feature_extractor(images=image, return_tensors="pt")
22
- outputs = model(**inputs)
23
- logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
 
1
  import gradio as gr
2
 
3
+ from matplotlib import gridspec
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
  from PIL import Image
7
+ import tensorflow as tf
8
+ from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
9
 
10
+ feature_extractor = SegformerFeatureExtractor.from_pretrained(
11
  "nvidia/segformer-b0-finetuned-ade-512-512"
12
  )
13
+ model = TFSegformerForSemanticSegmentation.from_pretrained(
14
+ "nvidia/segformer-b0-finetuned-ade-512-512"
 
15
  )
 
16
 
17
+ def ade_palette():
18
+ """ADE20K palette that maps each class to RGB values."""
19
+ return [
20
+ [53, 53, 53],
21
+ [0, 84, 255],
22
+ [171, 242, 0],
23
+ [255, 0, 221],
24
+ [255, 228, 0],
25
+ [92, 209, 229],
26
+ [153, 56, 0],
27
+ [128, 65, 217],
28
+ [116, 116, 116],
29
+ [47, 157, 39],
30
+ [217, 65, 140],
31
+ [255, 255, 255],
32
+ [255, 178, 245],
33
+ [61, 183, 204],
34
+ [153, 0, 76],
35
+ [71, 102, 0],
36
+ [255, 167, 167],
37
+ [25, 25, 25],
38
+ [53, 53, 53],
39
+ [0, 84, 255],
40
+ [171, 242, 0],
41
+ [255, 0, 221],
42
+ [255, 228, 0],
43
+ [92, 209, 229],
44
+ [153, 56, 0],
45
+ [128, 65, 217],
46
+ [53, 53, 53],
47
+ [0, 84, 255],
48
+ [171, 242, 0],
49
+ [255, 0, 221],
50
+ [255, 228, 0],
51
+ [92, 209, 229],
52
+ [153, 56, 0],
53
+ [128, 65, 217],
54
+ [53, 53, 53],
55
+ [0, 84, 255],
56
+ [171, 242, 0],
57
+ [255, 0, 221],
58
+ [255, 228, 0],
59
+ [92, 209, 229],
60
+ [153, 56, 0],
61
+ [128, 65, 217],
62
+ [53, 53, 53],
63
+ [0, 84, 255],
64
+ [171, 242, 0],
65
+ [255, 0, 221],
66
+ [255, 228, 0],
67
+ [92, 209, 229],
68
+ [153, 56, 0],
69
+ [128, 65, 217],
70
+ [53, 53, 53],
71
+ [0, 84, 255],
72
+ [171, 242, 0],
73
+ [255, 0, 221],
74
+ [255, 228, 0],
75
+ [92, 209, 229],
76
+ [153, 56, 0],
77
+ [128, 65, 217],
78
+ [0, 84, 255],
79
+ [171, 242, 0],
80
+ [255, 0, 221],
81
+ [255, 228, 0],
82
+ [92, 209, 229],
83
+ [153, 56, 0],
84
+ [128, 65, 217],
85
+ [53, 53, 53],
86
+ [0, 84, 255],
87
+ [171, 242, 0],
88
+ [255, 0, 221],
89
+ [255, 228, 0],
90
+ [92, 209, 229],
91
+ [153, 56, 0],
92
+ [128, 65, 217],
93
+ [53, 53, 53],
94
+ [0, 84, 255],
95
+ [171, 242, 0],
96
+ [255, 0, 221],
97
+ [255, 228, 0],
98
+ [92, 209, 229],
99
+ [153, 56, 0],
100
+ [128, 65, 217],
101
+ [53, 53, 53],
102
+ [0, 84, 255],
103
+ [171, 242, 0],
104
+ [255, 0, 221],
105
+ [255, 228, 0],
106
+ [92, 209, 229],
107
+ [153, 56, 0],
108
+ [128, 65, 217],
109
+ [53, 53, 53],
110
+ [0, 84, 255],
111
+ [171, 242, 0],
112
+ [255, 0, 221],
113
+ [255, 228, 0],
114
+ [92, 209, 229],
115
+ [153, 56, 0],
116
+ [128, 65, 217],
117
+ [53, 53, 53],
118
+ [0, 84, 255],
119
+ [171, 242, 0],
120
+ [255, 0, 221],
121
+ [255, 228, 0],
122
+ [92, 209, 229],
123
+ [153, 56, 0],
124
+ [128, 65, 217],
125
+ [53, 53, 53],
126
+ [0, 84, 255],
127
+ [171, 242, 0],
128
+ [255, 0, 221],
129
+ [255, 228, 0],
130
+ [92, 209, 229],
131
+ [153, 56, 0],
132
+ [128, 65, 217],
133
+ [53, 53, 53],
134
+ [0, 84, 255],
135
+ [171, 242, 0],
136
+ [255, 0, 221],
137
+ [255, 228, 0],
138
+ [92, 209, 229],
139
+ [153, 56, 0],
140
+ [128, 65, 217],
141
+ [53, 53, 53],
142
+ [0, 84, 255],
143
+ [171, 242, 0],
144
+ [255, 0, 221],
145
+ [255, 228, 0],
146
+ [92, 209, 229],
147
+ [153, 56, 0],
148
+ [128, 65, 217],
149
+ [53, 53, 53],
150
+ [0, 84, 255],
151
+ [171, 242, 0],
152
+ [255, 0, 221],
153
+ [255, 228, 0],
154
+ [92, 209, 229],
155
+ [153, 56, 0],
156
+ [128, 65, 217],
157
+ [53, 53, 53],
158
+ [0, 84, 255],
159
+ [171, 242, 0],
160
+ [255, 0, 221],
161
+ [255, 228, 0],
162
+ [92, 209, 229],
163
+ [153, 56, 0],
164
+ [128, 65, 217],
165
+ [53, 53, 53],
166
+ [0, 84, 255],
167
+ [171, 242, 0],
168
+ [255, 0, 221],
169
+ [255, 228, 0],
170
+
171
+
172
+ ]
173
+
174
+ labels_list = []
175
+
176
+ with open(r'labels.txt', 'r') as fp:
177
+ for line in fp:
178
+ labels_list.append(line[:-1])
179
+
180
+ colormap = np.asarray(ade_palette())
181
+
182
+ def label_to_color_image(label):
183
+ if label.ndim != 2:
184
+ raise ValueError("Expect 2-D input label")
185
+
186
+ if np.max(label) >= len(colormap):
187
+ raise ValueError("label value too large.")
188
+ return colormap[label]
189
+
190
+ def draw_plot(pred_img, seg):
191
+ fig = plt.figure(figsize=(20, 15))
192
+
193
+ grid_spec = gridspec.GridSpec(1, 2, width_ratios=[6, 1])
194
+
195
+ plt.subplot(grid_spec[0])
196
+ plt.imshow(pred_img)
197
+ plt.axis('off')
198
+ LABEL_NAMES = np.asarray(labels_list)
199
+ FULL_LABEL_MAP = np.arange(len(LABEL_NAMES)).reshape(len(LABEL_NAMES), 1)
200
+ FULL_COLOR_MAP = label_to_color_image(FULL_LABEL_MAP)
201
+
202
+ unique_labels = np.unique(seg.numpy().astype("uint8"))
203
+ ax = plt.subplot(grid_spec[1])
204
+ plt.imshow(FULL_COLOR_MAP[unique_labels].astype(np.uint8), interpolation="nearest")
205
+ ax.yaxis.tick_right()
206
+ plt.yticks(range(len(unique_labels)), LABEL_NAMES[unique_labels])
207
+ plt.xticks([], [])
208
+ ax.tick_params(width=0.0, labelsize=25)
209
+ return fig
210
+
211
+ def sepia(input_img):
212
+ input_img = Image.fromarray(input_img)
213
+
214
+ inputs = feature_extractor(images=input_img, return_tensors="tf")
215
+ outputs = model(**inputs)
216
+ logits = outputs.logits
217
+
218
+ logits = tf.transpose(logits, [0, 2, 3, 1])
219
+ logits = tf.image.resize(
220
+ logits, input_img.size[::-1]
221
+ ) # We reverse the shape of `image` because `image.size` returns width and height.
222
+ seg = tf.math.argmax(logits, axis=-1)[0]
223
+
224
+ color_seg = np.zeros(
225
+ (seg.shape[0], seg.shape[1], 3), dtype=np.uint8
226
+ ) # height, width, 3
227
+ for label, color in enumerate(colormap):
228
+ color_seg[seg.numpy() == label, :] = color
229
+
230
+ # Show image + mask
231
+ pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
232
+ pred_img = pred_img.astype(np.uint8)
233
+
234
+ fig = draw_plot(pred_img, seg)
235
+ return fig
236
 
237
+ demo = gr.Interface(fn=sepia,
238
+ inputs=gr.Image(shape=(400, 600)),
239
+ outputs=['plot'],
240
+ examples=["image_1.jpg", "image_2.jpg", "image_3.jpg", "image_4.jpg", "image_5.jpg"],
241
+ allow_flagging='never')
242
 
 
 
243
 
244
+ demo.launch()
 
 
config.json DELETED
@@ -1,372 +0,0 @@
1
- {
2
- "architectures": [
3
- "SegformerForSemanticSegmentation"
4
- ],
5
- "attention_probs_dropout_prob": 0.0,
6
- "classifier_dropout_prob": 0.1,
7
- "decoder_hidden_size": 256,
8
- "depths": [
9
- 2,
10
- 2,
11
- 2,
12
- 2
13
- ],
14
- "downsampling_rates": [
15
- 1,
16
- 4,
17
- 8,
18
- 16
19
- ],
20
- "drop_path_rate": 0.1,
21
- "hidden_act": "gelu",
22
- "hidden_dropout_prob": 0.0,
23
- "hidden_sizes": [
24
- 32,
25
- 64,
26
- 160,
27
- 256
28
- ],
29
- "id2label": {
30
- "0": "wall",
31
- "1": "building",
32
- "2": "sky",
33
- "3": "floor",
34
- "4": "tree",
35
- "5": "ceiling",
36
- "6": "road",
37
- "7": "bed ",
38
- "8": "windowpane",
39
- "9": "grass",
40
- "10": "cabinet",
41
- "11": "sidewalk",
42
- "12": "person",
43
- "13": "earth",
44
- "14": "door",
45
- "15": "table",
46
- "16": "mountain",
47
- "17": "plant",
48
- "18": "curtain",
49
- "19": "chair",
50
- "20": "car",
51
- "21": "water",
52
- "22": "painting",
53
- "23": "sofa",
54
- "24": "shelf",
55
- "25": "house",
56
- "26": "sea",
57
- "27": "mirror",
58
- "28": "rug",
59
- "29": "field",
60
- "30": "armchair",
61
- "31": "seat",
62
- "32": "fence",
63
- "33": "desk",
64
- "34": "rock",
65
- "35": "wardrobe",
66
- "36": "lamp",
67
- "37": "bathtub",
68
- "38": "railing",
69
- "39": "cushion",
70
- "40": "base",
71
- "41": "box",
72
- "42": "column",
73
- "43": "signboard",
74
- "44": "chest of drawers",
75
- "45": "counter",
76
- "46": "sand",
77
- "47": "sink",
78
- "48": "skyscraper",
79
- "49": "fireplace",
80
- "50": "refrigerator",
81
- "51": "grandstand",
82
- "52": "path",
83
- "53": "stairs",
84
- "54": "runway",
85
- "55": "case",
86
- "56": "pool table",
87
- "57": "pillow",
88
- "58": "screen door",
89
- "59": "stairway",
90
- "60": "river",
91
- "61": "bridge",
92
- "62": "bookcase",
93
- "63": "blind",
94
- "64": "coffee table",
95
- "65": "toilet",
96
- "66": "flower",
97
- "67": "book",
98
- "68": "hill",
99
- "69": "bench",
100
- "70": "countertop",
101
- "71": "stove",
102
- "72": "palm",
103
- "73": "kitchen island",
104
- "74": "computer",
105
- "75": "swivel chair",
106
- "76": "boat",
107
- "77": "bar",
108
- "78": "arcade machine",
109
- "79": "hovel",
110
- "80": "bus",
111
- "81": "towel",
112
- "82": "light",
113
- "83": "truck",
114
- "84": "tower",
115
- "85": "chandelier",
116
- "86": "awning",
117
- "87": "streetlight",
118
- "88": "booth",
119
- "89": "television receiver",
120
- "90": "airplane",
121
- "91": "dirt track",
122
- "92": "apparel",
123
- "93": "pole",
124
- "94": "land",
125
- "95": "bannister",
126
- "96": "escalator",
127
- "97": "ottoman",
128
- "98": "bottle",
129
- "99": "buffet",
130
- "100": "poster",
131
- "101": "stage",
132
- "102": "van",
133
- "103": "ship",
134
- "104": "fountain",
135
- "105": "conveyer belt",
136
- "106": "canopy",
137
- "107": "washer",
138
- "108": "plaything",
139
- "109": "swimming pool",
140
- "110": "stool",
141
- "111": "barrel",
142
- "112": "basket",
143
- "113": "waterfall",
144
- "114": "tent",
145
- "115": "bag",
146
- "116": "minibike",
147
- "117": "cradle",
148
- "118": "oven",
149
- "119": "ball",
150
- "120": "food",
151
- "121": "step",
152
- "122": "tank",
153
- "123": "trade name",
154
- "124": "microwave",
155
- "125": "pot",
156
- "126": "animal",
157
- "127": "bicycle",
158
- "128": "lake",
159
- "129": "dishwasher",
160
- "130": "screen",
161
- "131": "blanket",
162
- "132": "sculpture",
163
- "133": "hood",
164
- "134": "sconce",
165
- "135": "vase",
166
- "136": "traffic light",
167
- "137": "tray",
168
- "138": "ashcan",
169
- "139": "fan",
170
- "140": "pier",
171
- "141": "crt screen",
172
- "142": "plate",
173
- "143": "monitor",
174
- "144": "bulletin board",
175
- "145": "shower",
176
- "146": "radiator",
177
- "147": "glass",
178
- "148": "clock",
179
- "149": "flag"
180
- },
181
- "image_size": 224,
182
- "initializer_range": 0.02,
183
- "label2id": {
184
- "airplane": 90,
185
- "animal": 126,
186
- "apparel": 92,
187
- "arcade machine": 78,
188
- "armchair": 30,
189
- "ashcan": 138,
190
- "awning": 86,
191
- "bag": 115,
192
- "ball": 119,
193
- "bannister": 95,
194
- "bar": 77,
195
- "barrel": 111,
196
- "base": 40,
197
- "basket": 112,
198
- "bathtub": 37,
199
- "bed ": 7,
200
- "bench": 69,
201
- "bicycle": 127,
202
- "blanket": 131,
203
- "blind": 63,
204
- "boat": 76,
205
- "book": 67,
206
- "bookcase": 62,
207
- "booth": 88,
208
- "bottle": 98,
209
- "box": 41,
210
- "bridge": 61,
211
- "buffet": 99,
212
- "building": 1,
213
- "bulletin board": 144,
214
- "bus": 80,
215
- "cabinet": 10,
216
- "canopy": 106,
217
- "car": 20,
218
- "case": 55,
219
- "ceiling": 5,
220
- "chair": 19,
221
- "chandelier": 85,
222
- "chest of drawers": 44,
223
- "clock": 148,
224
- "coffee table": 64,
225
- "column": 42,
226
- "computer": 74,
227
- "conveyer belt": 105,
228
- "counter": 45,
229
- "countertop": 70,
230
- "cradle": 117,
231
- "crt screen": 141,
232
- "curtain": 18,
233
- "cushion": 39,
234
- "desk": 33,
235
- "dirt track": 91,
236
- "dishwasher": 129,
237
- "door": 14,
238
- "earth": 13,
239
- "escalator": 96,
240
- "fan": 139,
241
- "fence": 32,
242
- "field": 29,
243
- "fireplace": 49,
244
- "flag": 149,
245
- "floor": 3,
246
- "flower": 66,
247
- "food": 120,
248
- "fountain": 104,
249
- "glass": 147,
250
- "grandstand": 51,
251
- "grass": 9,
252
- "hill": 68,
253
- "hood": 133,
254
- "house": 25,
255
- "hovel": 79,
256
- "kitchen island": 73,
257
- "lake": 128,
258
- "lamp": 36,
259
- "land": 94,
260
- "light": 82,
261
- "microwave": 124,
262
- "minibike": 116,
263
- "mirror": 27,
264
- "monitor": 143,
265
- "mountain": 16,
266
- "ottoman": 97,
267
- "oven": 118,
268
- "painting": 22,
269
- "palm": 72,
270
- "path": 52,
271
- "person": 12,
272
- "pier": 140,
273
- "pillow": 57,
274
- "plant": 17,
275
- "plate": 142,
276
- "plaything": 108,
277
- "pole": 93,
278
- "pool table": 56,
279
- "poster": 100,
280
- "pot": 125,
281
- "radiator": 146,
282
- "railing": 38,
283
- "refrigerator": 50,
284
- "river": 60,
285
- "road": 6,
286
- "rock": 34,
287
- "rug": 28,
288
- "runway": 54,
289
- "sand": 46,
290
- "sconce": 134,
291
- "screen": 130,
292
- "screen door": 58,
293
- "sculpture": 132,
294
- "sea": 26,
295
- "seat": 31,
296
- "shelf": 24,
297
- "ship": 103,
298
- "shower": 145,
299
- "sidewalk": 11,
300
- "signboard": 43,
301
- "sink": 47,
302
- "sky": 2,
303
- "skyscraper": 48,
304
- "sofa": 23,
305
- "stage": 101,
306
- "stairs": 53,
307
- "stairway": 59,
308
- "step": 121,
309
- "stool": 110,
310
- "stove": 71,
311
- "streetlight": 87,
312
- "swimming pool": 109,
313
- "swivel chair": 75,
314
- "table": 15,
315
- "tank": 122,
316
- "television receiver": 89,
317
- "tent": 114,
318
- "toilet": 65,
319
- "towel": 81,
320
- "tower": 84,
321
- "trade name": 123,
322
- "traffic light": 136,
323
- "tray": 137,
324
- "tree": 4,
325
- "truck": 83,
326
- "van": 102,
327
- "vase": 135,
328
- "wall": 0,
329
- "wardrobe": 35,
330
- "washer": 107,
331
- "water": 21,
332
- "waterfall": 113,
333
- "windowpane": 8
334
- },
335
- "layer_norm_eps": 1e-06,
336
- "mlp_ratios": [
337
- 4,
338
- 4,
339
- 4,
340
- 4
341
- ],
342
- "model_type": "segformer",
343
- "num_attention_heads": [
344
- 1,
345
- 2,
346
- 5,
347
- 8
348
- ],
349
- "num_channels": 3,
350
- "num_encoder_blocks": 4,
351
- "patch_sizes": [
352
- 7,
353
- 3,
354
- 3,
355
- 3
356
- ],
357
- "reshape_last_stage": true,
358
- "sr_ratios": [
359
- 8,
360
- 4,
361
- 2,
362
- 1
363
- ],
364
- "strides": [
365
- 4,
366
- 2,
367
- 2,
368
- 2
369
- ],
370
- "torch_dtype": "float32",
371
- "transformers_version": "4.12.0.dev0"
372
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
image.jpg ADDED
image_1.jpg ADDED
image_2.jpg ADDED
image_3.jpg ADDED
image_4.jpg ADDED
labels.txt ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wall
2
+ building
3
+ sky
4
+ floor
5
+ tree
6
+ ceiling
7
+ road
8
+ bed
9
+ windowpane
10
+ grass
11
+ cabinet
12
+ sidewalk
13
+ person
14
+ earth
15
+ door
16
+ table
17
+ mountain
18
+ plant
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
preprocessor_config.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "do_normalize": true,
3
- "do_resize": true,
4
- "feature_extractor_type": "SegformerFeatureExtractor",
5
- "image_mean": [
6
- 0.485,
7
- 0.456,
8
- 0.406
9
- ],
10
- "image_std": [
11
- 0.229,
12
- 0.224,
13
- 0.225
14
- ],
15
- "reduce_labels": true,
16
- "resample": 2,
17
- "size": 512
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pytorch_model.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0f4df97633cbedd558ecffa3ad228ace5af37e082678390b45a9d22745787c61
3
- size 15092257
 
 
 
 
requirements.txt CHANGED
@@ -1,2 +1,6 @@
1
  torch
2
- transformers
 
 
 
 
 
1
  torch
2
+ transformers
3
+ tensorflow
4
+ numpy
5
+ Image
6
+ matplotlib
tf_model.h5 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d38f99e2a8e73bbdb4635669be5bfcbbfc85b4b5c1ac75d36b47312c7fc5d06e
3
- size 15285696