import numpy as np
from easydict import EasyDict

__C = EasyDict()

config = __C

__C.USE_GPU_NMS = True
__C.GPU_ID = 0

__C.ANCHOR_SCALES = [8, 16, 32]
__C.N_CLASSES = 21

__C.TARGET_SIZE = 1000

__C.TRAIN = EasyDict()

__C.TRAIN.LEARNING_RATE = 1e-3
__C.TRAIN.MOMENTUM = 0.9
__C.TRAIN.GAMMA = 0.1
__C.TRAIN.STEPSIZE = 200000

__C.TRAIN.RPN_NEGATIVE_OVERLAP = 0.3
__C.TRAIN.RPN_POSITIVE_OVERLAP = 0.7

__C.TRAIN.RPN_PRE_NMS_TOP_N = 12000
__C.TRAIN.RPN_POST_NMS_TOP_N = 2000

__C.TRAIN.RPN_NMS_THRESHOLD = 0.7
__C.TRAIN.RPN_MIN_SIZE = 16
__C.TRAIN.WEIGHT_DECAY = 0.0005

# Factor for reducing the learning rate
__C.TRAIN.GAMMA = 0.1

# Whether to double the learning rate for bias
__C.TRAIN.DOUBLE_BIAS = True

# Whether to initialize the weights with truncated normal distribution
__C.TRAIN.TRUNCATED = False

# Whether to have weight decay on bias as well
__C.TRAIN.BIAS_DECAY = False

##### RPN OPTION ####
__C.ANCHOR_SCALES = np.array([8, 16, 32])

__C.ANCHOR_RATIOS = [0.5, 1, 2]

# Down-sampling ratio
__C.FEAT_STRIDE = [
    16,
]

__C.TRAIN.RPN_CLOBBER_POSITIVES = False

__C.TRAIN.RPN_POSITIVE_OVERLAP = 0.7

__C.TRAIN.RPN_NEGATIVE_OVERLAP = 0.3

__C.TRAIN.RPN_BATCHSIZE = 256