chansung commited on
Commit
0934f7b
1 Parent(s): 9ef9868

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +152 -5
app.py CHANGED
@@ -170,6 +170,158 @@ def ade_palette():
170
  [92, 0, 255],
171
  ]
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  def label_to_color_image(label):
174
  """Adds color defined by the dataset colormap to the label.
175
 
@@ -204,11 +356,6 @@ def draw_plot(pred_img, seg):
204
  plt.imshow(pred_img)
205
  plt.axis('off')
206
 
207
- ade20k_labels_info = pd.read_csv(
208
- "https://raw.githubusercontent.com/CSAILVision/sceneparsing/master/objectInfo150.csv"
209
- )
210
- labels_list = list(ade20k_labels_info["Name"])
211
-
212
  LABEL_NAMES = np.asarray(labels_list)
213
  FULL_LABEL_MAP = np.arange(len(LABEL_NAMES)).reshape(len(LABEL_NAMES), 1)
214
  FULL_COLOR_MAP = label_to_color_image(FULL_LABEL_MAP)
 
170
  [92, 0, 255],
171
  ]
172
 
173
+ labels_list = [
174
+ 'wall',
175
+ 'building;edifice',
176
+ 'sky',
177
+ 'floor;flooring',
178
+ 'tree',
179
+ 'ceiling',
180
+ 'road;route',
181
+ 'bed',
182
+ 'windowpane;window',
183
+ 'grass',
184
+ 'cabinet',
185
+ 'sidewalk;pavement',
186
+ 'person;individual;someone;somebody;mortal;soul',
187
+ 'earth;ground',
188
+ 'door;double;door',
189
+ 'table',
190
+ 'mountain;mount',
191
+ 'plant;flora;plant;life',
192
+ 'curtain;drape;drapery;mantle;pall',
193
+ 'chair',
194
+ 'car;auto;automobile;machine;motorcar',
195
+ 'water',
196
+ 'painting;picture',
197
+ 'sofa;couch;lounge',
198
+ 'shelf',
199
+ 'house',
200
+ 'sea',
201
+ 'mirror',
202
+ 'rug;carpet;carpeting',
203
+ 'field',
204
+ 'armchair',
205
+ 'seat',
206
+ 'fence;fencing',
207
+ 'desk',
208
+ 'rock;stone',
209
+ 'wardrobe;closet;press',
210
+ 'lamp',
211
+ 'bathtub;bathing;tub;bath;tub',
212
+ 'railing;rail',
213
+ 'cushion',
214
+ 'base;pedestal;stand',
215
+ 'box',
216
+ 'column;pillar',
217
+ 'signboard;sign',
218
+ 'chest;of;drawers;chest;bureau;dresser',
219
+ 'counter',
220
+ 'sand',
221
+ 'sink',
222
+ 'skyscraper',
223
+ 'fireplace;hearth;open;fireplace',
224
+ 'refrigerator;icebox',
225
+ 'grandstand;covered;stand',
226
+ 'path',
227
+ 'stairs;steps',
228
+ 'runway',
229
+ 'case;display;case;showcase;vitrine',
230
+ 'pool;table;billiard;table;snooker;table',
231
+ 'pillow',
232
+ 'screen;door;screen',
233
+ 'stairway;staircase',
234
+ 'river',
235
+ 'bridge;span',
236
+ 'bookcase',
237
+ 'blind;screen',
238
+ 'coffee;table;cocktail;table',
239
+ 'toilet;can;commode;crapper;pot;potty;stool;throne',
240
+ 'flower',
241
+ 'book',
242
+ 'hill',
243
+ 'bench',
244
+ 'countertop',
245
+ 'stove;kitchen;stove;range;kitchen;range;cooking;stove',
246
+ 'palm;palm;tree',
247
+ 'kitchen;island',
248
+ 'computer;computing;machine;computing;device;data;processor;electronic;computer;information;processing;system',
249
+ 'swivel;chair',
250
+ 'boat',
251
+ 'bar',
252
+ 'arcade;machine',
253
+ 'hovel;hut;hutch;shack;shanty',
254
+ 'bus;autobus;coach;charabanc;double-decker;jitney;motorbus;motorcoach;omnibus;passenger;vehicle',
255
+ 'towel',
256
+ 'light;light;source',
257
+ 'truck;motortruck',
258
+ 'tower',
259
+ 'chandelier;pendant;pendent',
260
+ 'awning;sunshade;sunblind',
261
+ 'streetlight;street;lamp',
262
+ 'booth;cubicle;stall;kiosk',
263
+ 'television;television;receiver;television;set;tv;tv;set;idiot;box;boob;tube;telly;goggle;box',
264
+ 'airplane;aeroplane;plane',
265
+ 'dirt;track',
266
+ 'apparel;wearing;apparel;dress;clothes',
267
+ 'pole',
268
+ 'land;ground;soil',
269
+ 'bannister;banister;balustrade;balusters;handrail',
270
+ 'escalator;moving;staircase;moving;stairway',
271
+ 'ottoman;pouf;pouffe;puff;hassock',
272
+ 'bottle',
273
+ 'buffet;counter;sideboard',
274
+ 'poster;posting;placard;notice;bill;card',
275
+ 'stage',
276
+ 'van',
277
+ 'ship',
278
+ 'fountain',
279
+ 'conveyer;belt;conveyor;belt;conveyer;conveyor;transporter',
280
+ 'canopy',
281
+ 'washer;automatic;washer;washing;machine',
282
+ 'plaything;toy',
283
+ 'swimming;pool;swimming;bath;natatorium',
284
+ 'stool',
285
+ 'barrel;cask',
286
+ 'basket;handbasket',
287
+ 'waterfall;falls',
288
+ 'tent;collapsible;shelter',
289
+ 'bag',
290
+ 'minibike;motorbike',
291
+ 'cradle',
292
+ 'oven',
293
+ 'ball',
294
+ 'food;solid;food',
295
+ 'step;stair',
296
+ 'tank;storage;tank',
297
+ 'trade;name;brand;name;brand;marque',
298
+ 'microwave;microwave;oven',
299
+ 'pot;flowerpot',
300
+ 'animal;animate;being;beast;brute;creature;fauna',
301
+ 'bicycle;bike;wheel;cycle',
302
+ 'lake',
303
+ 'dishwasher;dish;washer;dishwashing;machine',
304
+ 'screen;silver;screen;projection;screen',
305
+ 'blanket;cover',
306
+ 'sculpture',
307
+ 'hood;exhaust;hood',
308
+ 'sconce',
309
+ 'vase',
310
+ 'traffic;light;traffic;signal;stoplight',
311
+ 'tray',
312
+ 'ashcan;trash;can;garbage;can;wastebin;ash;bin;ash-bin;ashbin;dustbin;trash;barrel;trash;bin',
313
+ 'fan',
314
+ 'pier;wharf;wharfage;dock',
315
+ 'crt;screen',
316
+ 'plate',
317
+ 'monitor;monitoring;device',
318
+ 'bulletin;board;notice;board',
319
+ 'shower',
320
+ 'radiator',
321
+ 'glass;drinking;glass',
322
+ 'clock',
323
+ 'flag']
324
+
325
  def label_to_color_image(label):
326
  """Adds color defined by the dataset colormap to the label.
327
 
 
356
  plt.imshow(pred_img)
357
  plt.axis('off')
358
 
 
 
 
 
 
359
  LABEL_NAMES = np.asarray(labels_list)
360
  FULL_LABEL_MAP = np.arange(len(LABEL_NAMES)).reshape(len(LABEL_NAMES), 1)
361
  FULL_COLOR_MAP = label_to_color_image(FULL_LABEL_MAP)