You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have trained with a custom dataset from CARLA with 29 classes which are stored with the tag information encoded in the red channel: A pixel with a red value of x belongs to an object with tag x. After training I ran it on my testing data and the results are not what I expected. I want the colors to match CARLA's CityScapesPalette in [carla.ColorConverter]. (https://carla.readthedocs.io/en/latest/python_api/#carla.ColorConverter)
I made a mapping for the original 150 classes to Carla's 29 classes. I updated the
`def segm_transform(self, segm):
# remap values in segm according to classMapping
segm = np.array(segm)[:, :, 0]
mapped_segm = np.zeros(segm.shape, dtype=np.uint64)
for k, v in self.classMapping.items():
mapped_segm[segm == k] = v
mapped_segm = torch.from_numpy(mapped_segm).long() - 1
return mapped_segm
#modify how segmenation masks are read for 13 classes in
#mapping their classes to Carla's classes
self.classMapping = {
1: 4, # wall -> Wall
2: 3, # building -> Building
3: 11, # sky -> Sky
4: 25, # floor -> ground
5: 9, # tree -> Vegetation
6: 10, # ceiling -> Terrain
7: 1, # road -> Roads
8: 22, # bed -> Other
9: 3, # window -> building
10: 10, # grass -> Terrain
11: 22, # cabinet -> other
12: 2, # sidewalk -> sidewalk
13: 12, # person -> Pedestrian
14: 10, # earth -> Terrain
15: 3, # door -> building
16: 22, # table -> other
17: 22, # mountain -> other
18: 9, # plant -> Vegetation
19: 22, # curtain -> other
20: 21, # chair -> dynamic
21: 14, # car -> Car
22: 23, # water -> Water
23: 22, # painting -> other
24: 22, # sofa -> other
25: 22, # shelf -> other
26: 3, # house -> building
27: 23, # sea -> water
28: 22, # mirror -> other
29: 22, # rug -> other
30: 10, # field -> Terrain
31: 20, # armchair -> Static
32: 20, # seat -> Static
33: 5, # fence -> Fence
34: 20, # desk -> Static
35: 3, # rock -> Building
36: 20, # wardrobe -> Static
37: 20, # lamp -> Static
38: 23, # bathtub -> Water
39: 5, # railing -> Fence
40: 20, # cushion -> Static
41: 20, # base -> Static
42: 20, # box -> Static
43: 5, # column -> Fence
44: 10, # signboard -> Terrain
45: 20, # chest of drawers -> Static
46: 20, # counter -> Static
47: 10, # sand -> Terrain
48: 23, # sink -> Water
49: 3, # skyscraper -> Building
50: 23, # fireplace -> Water
51: 23, # refrigerator -> Water
52: 20, # grandstand -> Static
53: 10, # path -> Terrain
54: 20, # stairs -> Static
55: 10, # runway -> Terrain
56: 20, # case -> Static
57: 20, # pool table -> Static
58: 20, # pillow -> Static
59: 20, # screen door -> Static
60: 20, # stairway -> Static
61: 23, # river -> Water
62: 10, # bridge -> Terrain
63: 20, # bookcase -> Static
64: 20, # blind -> Static
65: 20, # coffee table -> Static
66: 20, # toilet -> Static
67: 9, # flower -> Vegetation
68: 20, # book -> Static
69: 3, # hill -> Building
70: 20, # bench -> Static
71: 20, # countertop -> Static
72: 20, # stove -> Static
73: 9, # palm -> Vegetation
74: 20, # kitchen island -> Static
75: 20, # computer -> Static
76: 20, # swivel chair -> Static
77: 23, # boat -> Water
78: 20, # bar -> Static
79: 20, # arcade machine -> Static
80: 20, # hovel -> Static
81: 16, # bus -> Static
82: 20, # towel -> Static
83: 20, # light -> Static
84: 15, # truck -> Truck
85: 20, # tower -> Static
86: 20, # chandelier -> Static
87: 20, # awning -> Static
88: 20, # streetlight -> Static
89: 20, # booth -> Static
90: 20, # television -> Static
91: 20, # airplane -> Static
92: 25, # dirt track -> ground
93: 22, # apparel -> other
94: 6, # pole -> pole
95: 25, # land -> ground
96: 22, # bannister -> other
97: 22, # escalator -> other
98: 22, # ottoman -> other
99: 20, # bottle -> Static
100: 22, # buffet -> other
101: 20, # poster -> Static
102: 22, # stage -> other
103: 14, # van -> car
104: 21, # ship -> dynamic
105: 20, # fountain -> static
106: 22, # conveyer belt -> other
107: 22, # canopy -> other
108: 22, # washer -> other
109: 22, # plaything -> other
110: 22, # swimming pool -> Static
111: 22, # stool -> Static
112: 21, # barrel -> dynamic
113: 20, # basket -> Static
114: 23, # waterfall -> water
115: 20, # tent -> Static
116: 21, # bag -> dynamic
117: 19, # minibike -> bike
118: 20, # cradle -> Static
119: 20, # oven -> other
120: 21, # ball -> dynamic
121: 22, # food -> other
122: 22, # step -> other
123: 22, # tank -> other
124: 22, # trade name -> other
125: 22, # microwave -> other
126: 22, # pot -> Static
127: 21, # animal -> dynamic
128: 19, # bicycle -> bike
129: 23, # lake -> water
130: 22, # dishwasher -> other
131: 22, # screen -> other
132: 22, # blanket -> Static
133: 20, # sculpture -> Static
134: 22, # hood -> other
135: 22, # sconce -> other
136: 22, # vase -> other
137: 7, # traffic light -> traffic light
138: 22, # tray -> Static
139: 22, # ashcan -> Static
140: 22, # fan -> Static
141: 22, # pier -> Static
142: 22, # crt screen -> Static
143: 22, # plate -> Static
144: 22, # monitor -> Static
145: 22, # bulletin board -> Static
146: 22, # shower -> Static
147: 22, # radiator -> Static
148: 22, # glass -> Static
149: 22, # clock -> Static
150: 20 # flag -> Static
}`
I also made my own odgt files and updated the config.
The text was updated successfully, but these errors were encountered:
Hello,
I have trained with a custom dataset from CARLA with 29 classes which are stored with the tag information encoded in the red channel: A pixel with a red value of x belongs to an object with tag x. After training I ran it on my testing data and the results are not what I expected. I want the colors to match CARLA's CityScapesPalette in [carla.ColorConverter]. (https://carla.readthedocs.io/en/latest/python_api/#carla.ColorConverter)
I made a mapping for the original 150 classes to Carla's 29 classes. I updated the
`def segm_transform(self, segm):
# remap values in segm according to classMapping
segm = np.array(segm)[:, :, 0]
mapped_segm = np.zeros(segm.shape, dtype=np.uint64)
for k, v in self.classMapping.items():
mapped_segm[segm == k] = v
mapped_segm = torch.from_numpy(mapped_segm).long() - 1
return mapped_segm
#modify how segmenation masks are read for 13 classes in
#mapping their classes to Carla's classes
self.classMapping = {
1: 4, # wall -> Wall
2: 3, # building -> Building
3: 11, # sky -> Sky
4: 25, # floor -> ground
5: 9, # tree -> Vegetation
6: 10, # ceiling -> Terrain
7: 1, # road -> Roads
8: 22, # bed -> Other
9: 3, # window -> building
10: 10, # grass -> Terrain
11: 22, # cabinet -> other
12: 2, # sidewalk -> sidewalk
13: 12, # person -> Pedestrian
14: 10, # earth -> Terrain
15: 3, # door -> building
16: 22, # table -> other
17: 22, # mountain -> other
18: 9, # plant -> Vegetation
19: 22, # curtain -> other
20: 21, # chair -> dynamic
21: 14, # car -> Car
22: 23, # water -> Water
23: 22, # painting -> other
24: 22, # sofa -> other
25: 22, # shelf -> other
26: 3, # house -> building
27: 23, # sea -> water
28: 22, # mirror -> other
29: 22, # rug -> other
30: 10, # field -> Terrain
31: 20, # armchair -> Static
32: 20, # seat -> Static
33: 5, # fence -> Fence
34: 20, # desk -> Static
35: 3, # rock -> Building
36: 20, # wardrobe -> Static
37: 20, # lamp -> Static
38: 23, # bathtub -> Water
39: 5, # railing -> Fence
40: 20, # cushion -> Static
41: 20, # base -> Static
42: 20, # box -> Static
43: 5, # column -> Fence
44: 10, # signboard -> Terrain
45: 20, # chest of drawers -> Static
46: 20, # counter -> Static
47: 10, # sand -> Terrain
48: 23, # sink -> Water
49: 3, # skyscraper -> Building
50: 23, # fireplace -> Water
51: 23, # refrigerator -> Water
52: 20, # grandstand -> Static
53: 10, # path -> Terrain
54: 20, # stairs -> Static
55: 10, # runway -> Terrain
56: 20, # case -> Static
57: 20, # pool table -> Static
58: 20, # pillow -> Static
59: 20, # screen door -> Static
60: 20, # stairway -> Static
61: 23, # river -> Water
62: 10, # bridge -> Terrain
63: 20, # bookcase -> Static
64: 20, # blind -> Static
65: 20, # coffee table -> Static
66: 20, # toilet -> Static
67: 9, # flower -> Vegetation
68: 20, # book -> Static
69: 3, # hill -> Building
70: 20, # bench -> Static
71: 20, # countertop -> Static
72: 20, # stove -> Static
73: 9, # palm -> Vegetation
74: 20, # kitchen island -> Static
75: 20, # computer -> Static
76: 20, # swivel chair -> Static
77: 23, # boat -> Water
78: 20, # bar -> Static
79: 20, # arcade machine -> Static
80: 20, # hovel -> Static
81: 16, # bus -> Static
82: 20, # towel -> Static
83: 20, # light -> Static
84: 15, # truck -> Truck
85: 20, # tower -> Static
86: 20, # chandelier -> Static
87: 20, # awning -> Static
88: 20, # streetlight -> Static
89: 20, # booth -> Static
90: 20, # television -> Static
91: 20, # airplane -> Static
92: 25, # dirt track -> ground
93: 22, # apparel -> other
94: 6, # pole -> pole
95: 25, # land -> ground
96: 22, # bannister -> other
97: 22, # escalator -> other
98: 22, # ottoman -> other
99: 20, # bottle -> Static
100: 22, # buffet -> other
101: 20, # poster -> Static
102: 22, # stage -> other
103: 14, # van -> car
104: 21, # ship -> dynamic
105: 20, # fountain -> static
106: 22, # conveyer belt -> other
107: 22, # canopy -> other
108: 22, # washer -> other
109: 22, # plaything -> other
110: 22, # swimming pool -> Static
111: 22, # stool -> Static
112: 21, # barrel -> dynamic
113: 20, # basket -> Static
114: 23, # waterfall -> water
115: 20, # tent -> Static
116: 21, # bag -> dynamic
117: 19, # minibike -> bike
118: 20, # cradle -> Static
119: 20, # oven -> other
120: 21, # ball -> dynamic
121: 22, # food -> other
122: 22, # step -> other
123: 22, # tank -> other
124: 22, # trade name -> other
125: 22, # microwave -> other
126: 22, # pot -> Static
127: 21, # animal -> dynamic
128: 19, # bicycle -> bike
129: 23, # lake -> water
130: 22, # dishwasher -> other
131: 22, # screen -> other
132: 22, # blanket -> Static
133: 20, # sculpture -> Static
134: 22, # hood -> other
135: 22, # sconce -> other
136: 22, # vase -> other
137: 7, # traffic light -> traffic light
138: 22, # tray -> Static
139: 22, # ashcan -> Static
140: 22, # fan -> Static
141: 22, # pier -> Static
142: 22, # crt screen -> Static
143: 22, # plate -> Static
144: 22, # monitor -> Static
145: 22, # bulletin board -> Static
146: 22, # shower -> Static
147: 22, # radiator -> Static
148: 22, # glass -> Static
149: 22, # clock -> Static
150: 20 # flag -> Static
}`
I also made my own odgt files and updated the config.
The text was updated successfully, but these errors were encountered: