import numpy as np cnames = { 'background' : '0', 'apple' : '1', 'ball' : '2', 'banana' : '3', 'bell_pepper' : '4', 'binder' : '5', 'bowl' : '6', 'cereal_box' : '7', 'coffee_mug' : '8', 'flashlight' : '9', 'food_bag' : '10', 'food_box' : '11', 'food_can' : '12', 'glue_stick' : '13', 'hand_towel' : '14', 'instant_noodles' : '15', 'keyboard' : '16', 'kleenex' : '17', 'lemon' : '18', 'lime' : '19', 'marker' : '20', 'orange' : '21', 'peach' : '22', 'pear' : '23', 'potato' : '24', 'shampoo' : '25', 'soda_can' : '26', 'sponge' : '27', 'stapler' : '28', 'tomato' : '29', 'toothpaste' : '30', 'unknown' : '31' } colors = { 'b': np.array([0.0, 0.0, 1.0])*255, 'g': np.array([0.0, 0.5, 0.0])*255, 'r': np.array([1.0, 0.0, 0.0])*255, 'c': np.array([0.0, 0.75, 0.75])*255, 'm': np.array([0.75, 0, 0.75])*255, 'y': np.array([0.75, 0.75, 0])*255, 'w': np.array([1.0, 1.0, 1.0])*255, } colors_list = list(colors.values()) subnames = {'background': 0, 'apple_1': 1, 'apple_2': 2, 'ball_1': 3, 'ball_2': 4, 'ball_3': 5, 'banana_1': 6, 'banana_2': 7, 'bell_pepper_1': 8, 'binder_1': 9, 'bowl_1': 10, 'cereal_box_1': 11, 'cereal_box_3': 12, 'cereal_box_4': 13, 'cereal_box_5': 14, 'coffee_mug_1': 15, 'coffee_mug_2': 16, 'flashlight_1': 17, 'food_bag_2': 18, 'food_bag_3': 19, 'food_bag_4': 20, 'food_box_1': 21, 'food_box_2': 22, 'food_box_3': 23, 'food_can_1': 24, 'food_can_2': 25, 'food_can_3': 26, 'glue_stick_1': 27, 'hand_towel_1': 28, 'hand_towel_2': 29, 'hand_towel_3': 30, 'instant_noodles_1': 31, 'instant_noodles_2': 32, 'keyboard_1': 33, 'keyboard_2': 34, 'kleenex_1': 35, 'kleenex_2': 36, 'kleenex_3': 37, 'lemon_1': 38, 'lemon_2': 39, 'lime_1': 40, 'lime_2': 41, 'marker_1': 42, 'marker_2': 43, 'marker_3': 44, 'orange_1': 45, 'orange_2': 46, 'peach_1': 47, 'peach_2': 48, 'pear_1': 49, 'pear_2': 50, 'potato_1': 51, 'potato_2': 52, 'shampoo_1': 53, 'shampoo_2': 54, 'shampoo_3': 55, 'soda_can_1': 56, 'soda_can_2': 57, 'sponge_1': 58, 'sponge_2': 59, 'sponge_3': 60, 'stapler_1': 61, 'stapler_2': 62, 'tomato_1': 63, 'toothpaste_1': 64, 'toothpaste_2': 65, 'unknown': 66 } sub_to_class = {0: 0, 1: 1, 2: 1, 3: 2, 4: 2, 5: 2, 6: 3, 7: 3, 8: 4, 9: 5, 10: 6, 11: 7, 12: 7, 13: 7, 14: 7, 15: 8, 16: 8, 17: 9, 18: 10, 19: 10, 20: 10, 21: 11, 22: 11, 23: 11, 24: 12, 25: 12, 26: 12, 27: 13, 28: 14, 29: 14, 30: 14, 31: 15, 32: 15, 33: 16, 34: 16, 35: 17, 36: 17, 37: 17, 38: 18, 39: 18, 40: 19, 41: 19, 42: 20, 43: 20, 44: 20, 45: 21, 46: 21, 47: 22, 48: 22, 49: 23, 50: 23, 51: 24, 52: 24, 53: 25, 54: 25, 55: 25, 56: 26, 57: 26, 58: 27, 59: 27, 60: 27, 61: 28, 62: 28, 63: 29, 64: 30, 65: 30, 66: 31 }