def df_squeezeSeg_config(): """Specify the parameters to tune below.""" mc = base_model_config('DF') mc.BATCH_SIZE = 16 mc.AZIMUTH_LEVEL = 1024 mc.ZENITH_LEVEL = 32 mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 mc.RCRF_ITER = 3 mc.BILATERAL_THETA_A = np.array([.9, .9, .6, .6]) mc.BILATERAL_THETA_R = np.array([.015, .015, .01, .01]) mc.BI_FILTER_COEF = 0.1 mc.ANG_THETA_A = np.array([.9, .9, .6, .6]) mc.ANG_FILTER_COEF = 0.02 mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 8000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True # x, y, z, intensity, distance mc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) mc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) return mc
def imageNet_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.IMAGE_WIDTH = 224 mc.IMAGE_HEIGHT = 224 mc.BATCH_SIZE = 256 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.QUANTIZATION = False mc.IMAGENET = True return mc
def kitti_model_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') # mc.IMAGE_WIDTH = 1864 # half width 621 # mc.IMAGE_HEIGHT = 562 # half height 187 mc.IMAGE_WIDTH = 1242 # half width 621 mc.IMAGE_HEIGHT = 375 # half height 187 # mc.IMAGE_WIDTH = 621 # mc.IMAGE_HEIGHT = 187 mc.WEIGHT_DECAY = 0.0001 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.LEARNING_RATE = 0.01 mc.MOMENTUM = 0.9 mc.DECAY_STEPS = 10000 mc.LR_DECAY_FACTOR = 0.5 mc.BATCH_SIZE = 20 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.MAX_GRAD_NORM = 1.0 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 mc.USE_DECONV = False mc.EXCLUDE_HARD_EXAMPLES = False return mc
def imagenet_config(): """Specify the parameters to tune below.""" mc = base_model_config('ILSVRC2013') mc.DEBUG_MODE = False # Data Augmentation mc.DATA_AUGMENTATION = True # Network Architecture mc.BN = True mc.LOAD_BN = True # Remove BGR mean mc.SUB_BGR_MEANS = True mc.IMAGE_WIDTH = 224 mc.IMAGE_HEIGHT = 224 mc.BATCH_SIZE = 32 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 1e-3 mc.LR_POLICY = 'step' mc.LR_STEP_BOUNDRY = [10000, 15000] mc.LR_STEP_VALUE = [1e-3, 1e-4, 1e-5] mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 return mc
def cityscapes_squeezeDet_config(): """Specify the parameters to tune below.""" mc = base_model_config('cityscapes') mc.IMAGE_WIDTH = 320 # 1248 mc.IMAGE_HEIGHT = 160 # 384 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 38 # 150 mc.DRIFT_Y = 41 # 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 return mc
def kitti_vgg16_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.IMAGE_WIDTH = 224 mc.IMAGE_HEIGHT = 224 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_SHAPE = np.array( [[100, 100]]) mc.ANCHOR_BOX = set_anchors(mc, 1) mc.ANCHOR_BOX2 = set_anchors(mc, 2) mc.ANCHOR_BOX3 = set_anchors(mc, 4) # print(mc.ANCHOR_BOX3) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHORS2 = len(mc.ANCHOR_BOX2) mc.ANCHORS3 = len(mc.ANCHOR_BOX3) # print(mc.ANCHORS, mc.ANCHORS2, mc.ANCHORS3) mc.ANCHOR_TOTAL = mc.ANCHORS + mc.ANCHORS2 + mc.ANCHORS3 mc.ANCHOR_PER_GRID = 1 # mc.ANCHOR_SHAPE = np.array( # [[ 36., 37.], [ 366., 174.], [ 115., 59.], # [ 162., 87.], [ 38., 90.], [ 258., 173.], # [ 224., 108.], [ 78., 170.], [ 72., 43.]]) mc.PYRAMID_SCALE = [1, 2, 4] mc.SCALE_SIZE = 3 mc.LOAD_PRETRAINED_MODEL = True return mc
def kitti_squeezeSeg32_config_ext(): """ Parameters to tune after adding one class """ mc = base_model_config('KITTI') mc.CLASSES = ['unknown', 'car', 'pedestrian', 'cyclist', 'ground'] mc.NUM_CLASS = len(mc.CLASSES) mc.CLS_2_ID = dict(zip(mc.CLASSES, range(len(mc.CLASSES)))) #mc.CLS_LOSS_WEIGHT = np.array([1/15.0, 1.0, 10.0, 10.0, 1/10.0]) mc.CLS_LOSS_WEIGHT = np.array([0.00399712, 1.0, 0.68579656, 0.68579656, 0.01329]) mc.CLS_COLOR_MAP = np.array([[ 0.00, 0.00, 0.00], [ 0.12, 0.56, 0.37], [ 0.66, 0.55, 0.71], [ 0.58, 0.72, 0.88], [ 0.25, 0.51, 0.76]]) mc.BATCH_SIZE = 32 mc.AZIMUTH_LEVEL = 512 mc.ZENITH_LEVEL = 32 mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 #mc.RCRF_ITER = 3 mc.RCRF_ITER = 5 # Not sure if I need to change this mc.BI_FILTER_COEF = 0.1 mc.BILATERAL_THETA_A = np.array([0.9, 0.9, 0.6, 0.6, 0.9]) mc.BILATERAL_THETA_R = np.array([0.015, 0.015, 0.01, 0.01, 0.015]) mc.ANG_THETA_A = np.array([0.9, 0.9, 0.6, 0.6, 0.9]) mc.ANG_FILTER_COEF = 0.02 mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True # x, y, z, intensity, distance # mc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) mc.INPUT_MEAN = np.array([[[7.11174452147, 0.0943776729418, -0.500243253951, 0.110507476635,7.70754909688]]]) # mc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) mc.INPUT_STD = np.array([[[10.9252722964, 4.8862697957, 0.775360202555, 0.166859600962,11.6589714541]]]) mc.num_of_input_channels=5 mc.use_focal_loss=False mc.EVAL_ON_ORG=False return mc
def kitti_zynqDet_FPN_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') # mc.IMAGE_WIDTH = 1242 # mc.IMAGE_HEIGHT = 375 mc.IMAGE_WIDTH = 640 mc.IMAGE_HEIGHT = 480 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False # anchor_shapes = np.reshape( # [np.array( # [[ 127., 100.], [ 115., 162.], [ 248., 166.], # [ 161., 221.], [ 173., 150.], [ 191., 94.], # [ 85., 211.], [ 67., 118.], [ 70., 161.]])] * H * W, # (H, W, B, 2) # ) mc.ANCHOR_SHAPES = np.array([[224, 224]]) mc.ANCHOR_PER_GRID = 1 mc.ANCHOR_BOX = set_anchors(mc, 1) mc.ANCHOR_BOX2 = set_anchors(mc, 2) mc.ANCHOR_BOX3 = set_anchors(mc, 4) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHORS2 = len(mc.ANCHOR_BOX2) mc.ANCHORS3 = len(mc.ANCHOR_BOX3) mc.ANCHOR_TOTAL = mc.ANCHORS + mc.ANCHORS2 + mc.ANCHORS3 return mc
def kitti_squeezeSeg_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') print("Kitti preloaded =", mc.LOAD_PRETRAINED_MODEL) print("Loaded model path = ", mc.PRETRAINED_MODEL_PATH) mc.CLASSES = ['background', 'car'] mc.NUM_CLASS = len(mc.CLASSES) mc.CLS_2_ID = dict(zip(mc.CLASSES, range(len(mc.CLASSES)))) # controlling the relative importance of weights mc.CLS_LOSS_WEIGHT = np.array([1.0 / 15.0, 1.0]) mc.CLS_COLOR_MAP = np.array([[0.00, 0.00, 0.00], [0.12, 0.56, 0.37]]) mc.BATCH_SIZE = 32 # how many pixel long our projection is mc.AZIMUTH_LEVEL = 512 # how many pixel tall our projection is mc.ZENITH_LEVEL = 64 # Conditional Random Field mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 # How many times it is passed through the RNN mc.RCRF_ITER = 3 mc.BILATERAL_THETA_A = np.array([.9, .9, .6, .6]) mc.BILATERAL_THETA_R = np.array([.015, .015, .01, .01]) mc.BI_FILTER_COEF = 0.1 mc.ANG_THETA_A = np.array([.9, .9, .6, .6]) mc.ANG_FILTER_COEF = 0.02 # Loss coefficient mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.00001 mc.LEARNING_RATE = 0.0001 mc.DECAY_STEPS = 100 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.1 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True #mc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) #mc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) # x, y, z, intensity, distance mc.INPUT_MEAN = np.array([[[0, 0, 5, 0.5, 6]]]) mc.INPUT_STD = np.array([[[1, 1, 1, 1, 1]]]) return mc
def kitti_squeezeSeg16_config_ext(): """ Parameters to tune after adding one class """ mc = base_model_config('KITTI') mc.CLASSES = ['unknown', 'car', 'pedestrian', 'cyclist', 'ground'] mc.NUM_CLASS = len(mc.CLASSES) mc.CLS_2_ID = dict(zip(mc.CLASSES, range(len(mc.CLASSES)))) mc.CLS_LOSS_WEIGHT = np.array([1/15.0, 1.0, 10.0, 10.0, 1/15.0]) mc.CLS_COLOR_MAP = np.array([[ 0.00, 0.00, 0.00], [ 0.12, 0.56, 0.37], [ 0.66, 0.55, 0.71], [ 0.58, 0.72, 0.88], [ 0.25, 0.51, 0.76]]) mc.BATCH_SIZE = 32 mc.AZIMUTH_LEVEL = 512 mc.ZENITH_LEVEL = 16 mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 mc.RCRF_ITER = 3 # Not sure if I need to change this mc.BI_FILTER_COEF = 0.1 mc.BILATERAL_THETA_A = np.array([.9, .9, .6, .6, .9]) mc.BILATERAL_THETA_R = np.array([.015, .015, .01, .01, .015]) mc.ANG_THETA_A = np.array([.9, .9, .6, .6, .9]) mc.ANG_FILTER_COEF = 0.02 mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True # x, y, z, intensity, distance mc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) mc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) mc.num_of_input_channels=5 mc.use_focal_loss=False mc.EVAL_ON_ORG=False return mc
def pascal_voc_yolo_config(): """Specify the parameters to tune below.""" mc = base_model_config('PASCAL_VOC') mc.DEBUG_MODE = True mc.SUB_BGR_MEANS = False # Data Augmentation mc.LOSS_TYPE = 'YOLO' mc.DATA_AUG_TYPE = 'YOLO' # Network Architecture mc.BN = True mc.LOAD_BN = True mc.IMAGE_WIDTH = 416 mc.IMAGE_HEIGHT = 416 mc.BATCH_SIZE = 32 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 1e-3 mc.LR_POLICY = 'step' mc.LR_STEP_BOUNDRY = [10000, 15000] mc.LR_STEP_VALUE = [1e-3, 1e-4, 1e-5] mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LOSS_COEF_BBOX = 1.0 mc.LOSS_COEF_CONF_POS = 5.0 mc.LOSS_COEF_CONF_NEG = 1.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.4 mc.DATA_AUGMENTATION = True mc.NET_OUT_SHAPE = (13, 13, 5) # (H, W, B) mc.ANCHOR_BOX = set_anchors(mc, mc.NET_OUT_SHAPE[-1]) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 5 return mc
def kitti_squeezeDet_FPN_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') # mc.IMAGE_WIDTH = 1242 # mc.IMAGE_HEIGHT = 375 mc.IMAGE_WIDTH = 224 mc.IMAGE_HEIGHT = 224 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_SHAPES = np.array([[100, 100]]) mc.ANCHOR_PER_GRID = 1 mc.ANCHOR_BOX = set_anchors(mc, 1) mc.ANCHOR_BOX2 = set_anchors(mc, 2) mc.ANCHOR_BOX3 = set_anchors(mc, 4) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHORS2 = len(mc.ANCHOR_BOX2) mc.ANCHORS3 = len(mc.ANCHOR_BOX3) mc.ANCHOR_TOTAL = mc.ANCHORS + mc.ANCHORS2 + mc.ANCHORS3 return mc
def pascal_voc_vgg16_config(): """Specify the parameters to tune below.""" mc = base_model_config('PASCAL_VOC') mc.DEBUG_MODE = False # Data Augmentation #mc.LOSS_TYPE = 'YOLO' mc.DATA_AUG_TYPE = 'YOLO' # Network Architecture mc.BN = True mc.IMAGE_WIDTH = 416 mc.IMAGE_HEIGHT = 416 mc.BATCH_SIZE = 32 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 1e-3 mc.DECAY_STEPS = 2e4 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 50 mc.DRIFT_Y = 50 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 return mc
def kitti_squeezeSeg_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.CLASSES = ['unknown', 'car', 'pedestrian', 'cyclist'] mc.NUM_CLASS = len(mc.CLASSES) mc.CLS_2_ID = dict(zip(mc.CLASSES, range(len(mc.CLASSES)))) mc.CLS_LOSS_WEIGHT = np.array([1/3.0, 1.0, 3.5, 3.5]) mc.CLS_COLOR_MAP = np.array([[ 0.00, 0.00, 0.00], [ 0.12, 0.56, 0.37], [ 0.66, 0.55, 0.71], [ 0.58, 0.72, 0.88]]) mc.BATCH_SIZE = 6 mc.AZIMUTH_LEVEL = 512 mc.ZENITH_LEVEL = 64 mc.FOCAL_GAMMA = 2.0 mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 mc.RCRF_ITER = 3 mc.BILATERAL_THETA_A = np.array([.9, .9, .6, .6]) mc.BILATERAL_THETA_R = np.array([.015, .015, .01, .01]) mc.BI_FILTER_COEF = 0.1 mc.ANG_THETA_A = np.array([.9, .9, .6, .6]) mc.ANG_FILTER_COEF = 0.02 mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.05 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True # x, y, z, intensity, distance mc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) mc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) return mc
def vid_yolo_config(): """Specify the parameters to tune below.""" mc = base_model_config('VID') mc.DEBUG_MODE = False # Data Augmentation mc.LOSS_TYPE = 'YOLO' mc.DATA_AUG_TYPE = 'YOLO' # Network Architecture mc.BN = True mc.IMAGE_WIDTH = 416 mc.IMAGE_HEIGHT = 416 mc.BATCH_SIZE = 64 mc.WEIGHT_DECAY = 1e-4 mc.LEARNING_RATE = 1e-3 mc.DECAY_STEPS = 2e4 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 1.0 mc.LOSS_COEF_CONF_POS = 5.0 mc.LOSS_COEF_CONF_NEG = 1.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 return mc
def kitti_shuffledet_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.IMAGE_WIDTH = 1248 mc.IMAGE_HEIGHT = 384 # mc.IMAGE_WIDTH = 560 # mc.IMAGE_HEIGHT = 180 mc.BATCH_SIZE = 8 mc.WEIGHT_DECAY = 0.0005 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True # mc.DRIFT_X = 150/(1248./560) # mc.DRIFT_Y = 100/(384./180) mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 return mc
def kitti_res50_filter_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.IMAGE_WIDTH = 621 mc.IMAGE_HEIGHT = 187 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 net_output_height, net_output_width = 24, 78 mc.GRID_CELLS = net_output_height * net_output_width mc.CLASS_BIASSES = np.array([1.0, 1.0, 1.0], dtype=np.float32) / 3 return mc
def kitti_squeezeSeg_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') mc.NUM_BIN = 10 mc.BIN_INTERVALS = np.array([100] * 10) mc.MID_VALUES = np.array(range(50, 1000, 100)) mc.BIN_LOSS_WEIGHT = np.array([5, 5, 4, 4, 3, 3, 2, 2, 1, 1]) mc.BIN_LOSS_COEF = 4 mc.DELTA_LOSS_COEF = 30e-4 mc.SOFT_LABEL_SIGMA = 0.5 mc.BATCH_SIZE = 48 mc.AZIMUTH_LEVEL = 512 mc.ZENITH_LEVEL = 64 mc.LCN_HEIGHT = 3 mc.LCN_WIDTH = 5 mc.RCRF_ITER = 3 mc.BI_FILTER_COEF = 0.1 mc.ANG_FILTER_COEF = 0.02 mc.ECULIDEAN_LOSS_COEF = 15.0 mc.CLS_LOSS_COEF = 15.0 mc.WEIGHT_DECAY = 0.0001 #mc.LEARNING_RATE = 0.01 mc.LEARNING_RATE = 0.05 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.DATA_AUGMENTATION = True mc.RANDOM_FLIPPING = True # x, y, z, intensity, distance mc.INPUT_MEAN_KITTI = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) mc.INPUT_STD_KITTI = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) mc.INPUT_MEAN_GTAV = np.array([[[7.98, 0.22, -0.67, 8.91]]]) mc.INPUT_STD_GTAV = np.array([[[9.82, 5.43, 0.73, 10.56]]]) return mc
def kitti_squeezeDet_config(): """Specify the parameters to tune below.""" mc = base_model_config('KITTI') # mc.IMAGE_WIDTH = 1248 # mc.IMAGE_HEIGHT = 384 mc.IMAGE_WIDTH = 624 # 2448 / 4 -> 39 x 16 mc.IMAGE_HEIGHT = 512 # 2048 / 4 # mc.IMAGE_WIDTH = 1232 # 2448 / 2 -> 77 x 16 # mc.IMAGE_HEIGHT = 1024 # 2048 / 2 mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 10000 mc.MAX_GRAD_NORM = 1.0 mc.MOMENTUM = 0.9 mc.LR_DECAY_FACTOR = 0.5 mc.LOSS_COEF_BBOX = 5.0 mc.LOSS_COEF_CONF_POS = 75.0 mc.LOSS_COEF_CONF_NEG = 100.0 mc.LOSS_COEF_CLASS = 1.0 mc.PLOT_PROB_THRESH = 0.4 mc.NMS_THRESH = 0.4 mc.PROB_THRESH = 0.005 mc.TOP_N_DETECTION = 64 mc.DATA_AUGMENTATION = True mc.DRIFT_X = 150 mc.DRIFT_Y = 100 mc.EXCLUDE_HARD_EXAMPLES = False mc.ANCHOR_BOX = set_anchors(mc) mc.ANCHORS = len(mc.ANCHOR_BOX) mc.ANCHOR_PER_GRID = 9 return mc
def alibaba_squeezeSeg_config(): asc = base_model_config('KITTI') asc.CLASSES = [ 'DontCare', 'cyclist', 'tricycle', 'sm_allMot', 'bigMot', 'pedestrian', 'crowds', 'unknown', ] asc.NUM_CLASS = len(asc.CLASSES) asc.CLS_2_ID = dict(zip(asc.CLASSES, range(len(asc.CLASSES)))) asc.CLS_LOSS_WEIGHT = np.array( [1 / 10.0, 1.0, 10.0, 11.0, 8.0, 7.0, 9.0, 20.0]) asc.CLS_COLOR_MAP = np.array([[1.0, 1.0, 1.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.5, 0.0]]) asc.BATCH_SIZE = 32 asc.AZIMUTH_LEVEL = 512 asc.ZENITH_LEVEL = 64 asc.LCN_HEIGHT = 3 asc.LCN_WIDTH = 5 asc.RCRF_ITER = 3 asc.BILATERAL_THETA_A = np.array([.9, .6, .9, .6, .9, .6, .9, .6]) asc.BILATERAL_THETA_R = np.array( [.015, .01, .015, .01, .015, .01, .015, .01]) asc.BI_FILTER_COEF = 0.1 asc.ANG_THETA_A = np.array([.9, .6, .9, .6, .9, .6, .9, .6]) asc.ANG_FILTER_COEF = 0.02 asc.CLS_LOSS_COEF = 15.0 asc.WEIGHT_DECAY = 0.0008 # 0.0001 asc.LEARNING_RATE = 0.01 # origin 0.01 asc.DECAY_STEPS = 10000 asc.MAX_GRAD_NORM = 1.0 asc.MOMENTUM = 0.9 asc.LR_DECAY_FACTOR = 0.5 asc.DATA_AUGMENTATION = False asc.RANDOM_FLIPPING = False # x, y, z, intensity, distance asc.INPUT_MEAN = np.array([[[10.88, 0.23, -1.04, 0.21, 12.12]]]) asc.INPUT_STD = np.array([[[11.47, 6.91, 0.86, 0.16, 12.32]]]) return asc
def vkitti_SSD_config(): """Specify the parameters to tune below.""" mc = base_model_config('VKITTI') mc.VERSION = 'V1' mc.IMAGE_WIDTH = 300 mc.IMAGE_HEIGHT = 300 mc.BGR_MEANS = np.array([[[104,117,123]]]) mc.BATCH_SIZE = 20 mc.WEIGHT_DECAY = 0.0005 #0.00001 mc.LEARNING_RATE = 0.01 mc.DECAY_STEPS = 20000 mc.LR_DECAY_FACTOR = 0.5 mc.MAX_GRAD_NORM = 1.0 #1.0 mc.MOMENTUM = 0.9 mc.mbox_source_layers_name = ['conv4_3', 'fc7', 'conv6_2', 'conv7_2', 'conv8_2', 'conv9_2'] mc.normalizations = [20, -1, -1, -1, -1, -1] mc.bQuant = False cal_prior_param(mc) mc.BACKGROUD_ID = 0 mc.TOP_N_DETECTION = 400 mc.PROB_THRESH = 0.01 mc.NMS_THRESH = 0.45 mc.PLOT_PROB_THRESH = 0.4 mc.overlap_threshold = 0.5 #mc.keep_top_k = 200 print ('vkitti_SSD_config') #data layer params mc.batch_sampler = get_batch_sampler() mc.expand_param = edict() mc.expand_param.prob = 1.0 mc.expand_param.min_expand_ratio = 1.0 mc.expand_param.max_expand_ratio = 3.0 #multibox_loss layer params mc.multibox_loss_param = edict() mc.multibox_loss_param.overlap_threshold = 0.5 mc.multibox_loss_param.neg_pos_ratio = 3. mc.multibox_loss_param.neg_overlap = 0.5 mc.background_label_id = 0 #anchors mc.ANCHOR_BOX,mc.ANCHORS_NUM,mc.ANCHOR_PER_GRID = all_anchors(mc) mc.PRIORBOX_VARIANCES = all_prior_variance(mc) ''' print ('np.shape(mc.ANCHOR_BOX):',np.shape(mc.ANCHOR_BOX)) print ('mc.ANCHORS_NUM:',mc.ANCHORS_NUM) print ('np.shape(mc.PRIORBOX_VARIANCES):',np.shape(mc.PRIORBOX_VARIANCES)) priorboxes = np.concatenate([mc.ANCHOR_BOX,mc.PRIORBOX_VARIANCES],axis=0) save_array_to_txt_file('all_anchors.txt',mc.ANCHOR_BOX) save_array_to_txt_file('all_prior_variance.txt',mc.PRIORBOX_VARIANCES) save_array_to_txt_file('_priorboxes.txt',priorboxes) raw_input('pause') ''' mc.ADD_WEIGHT_DECAY_TO_LOSS = True mc.NUM_THREAD = 4 mc.QUEUE_CAPACITY = 100 return mc