File size: 2,416 Bytes
424188c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import numpy as np

wall_type = 1
floor_type = 2
ceil_type = 22

SCANNET_COLORMAP = [
[0., 0., 0.],
[174., 199., 232.],
[152., 223., 138.],
[31., 119., 180.],
[255., 187., 120.],
[188., 189., 34.],
[140., 86., 75.],
[255., 152., 150.],
[214., 39., 40.],
[197., 176., 213.],
[148., 103., 189.],
[196., 156., 148.],
[23., 190., 207.],
[247., 182., 210.],
[66., 188., 102.],
[219., 219., 141.],
[140., 57., 197.],
[202., 185., 52.],
[51., 176., 203.],
[200., 54., 131.],
[92., 193., 61.],
[78., 71., 183.],
[172., 114., 82.],
[255., 127., 14.],
[91., 163., 138.],
[153., 98., 156.],
[140., 153., 101.],
[158., 218., 229.],
[100., 125., 154.],
[178., 127., 135.],
[146., 111., 194.],
[44., 160., 44.],
[112., 128., 144.],
[96., 207., 209.],
[227., 119., 194.],
[213., 92., 176.],
[94., 106., 211.],
[82., 84., 163.],
[100., 85., 144.]]

SCANNET_COLORMAP = np.asarray(SCANNET_COLORMAP) / 255.

class_names = []
class_name_to_id = {}
for i, line in enumerate(open("label_names.txt").readlines()):
    class_id = i  # starts with -1
    class_name = line.strip()
    class_name_to_id[class_name] = class_id
    class_names.append(class_name)
class_names = tuple(class_names)

# color palette for nyu40 labels
def create_color_palette():
    return [
       (0, 0, 0),
       (174, 199, 232),		# wall
       (152, 223, 138),		# floor
       (31, 119, 180), 		# cabinet
       (255, 187, 120),		# bed
       (188, 189, 34), 		# chair
       (140, 86, 75),  		# sofa
       (255, 152, 150),		# table
       (214, 39, 40),  		# door
       (197, 176, 213),		# window
       (148, 103, 189),		# bookshelf
       (196, 156, 148),		# picture
       (23, 190, 207), 		# counter
       (178, 76, 76),
       (247, 182, 210),		# desk
       (66, 188, 102),
       (219, 219, 141),		# curtain
       (140, 57, 197),
       (202, 185, 52),
       (51, 176, 203),
       (200, 54, 131),
       (92, 193, 61),
       (78, 71, 183),
       (172, 114, 82),
       (255, 127, 14), 		# refrigerator
       (91, 163, 138),
       (153, 98, 156),
       (140, 153, 101),
       (158, 218, 229),		# shower curtain
       (100, 125, 154),
       (178, 127, 135),
       (120, 185, 128),
       (146, 111, 194),
       (44, 160, 44),  		# toilet
       (112, 128, 144),		# sink
       (96, 207, 209),
       (227, 119, 194),		# bathtub
       (213, 92, 176),
       (94, 106, 211),
       (82, 84, 163),  		# otherfurn
       (100, 85, 144)
    ]