from yacs.config import CfgNode as CN

_C = CN()

_C.CONFIG = CN()
_C.CONFIG.SAVED_FILE = 'config.yaml'

# Dasaset
_C.DATASET = CN()
_C.DATASET.NAME = 'market'
_C.DATASET.DATA_DIR = '/root/Market-1501-v15.09.15'
_C.DATASET.NUM_CLASS = 751


# Input
_C.INPUT = CN()
_C.INPUT.PIXEL_MEAN = [0.485, 0.456, 0.406]
_C.INPUT.PIXEL_STD = [0.229, 0.224, 0.225]
_C.INPUT.SIZE_TRAIN = [256, 128]
_C.INPUT.PADDING = 10
_C.INPUT.RE_PROB = 0.5
_C.INPUT.RANDOM_ERASING = False


# Dataloader
_C.DATALOADER = CN()
_C.DATALOADER.NUM_WORKERS = 8
_C.DATALOADER.NUM_INSTANCE = 4


## MODEL
_C.MODEL = CN()
_C.MODEL.NAME = 'resnet50'
_C.MODEL.RESNET_STRIDE = 2


# Train
_C.TRAIN = CN()
_C.TRAIN.BATCHSIZE = 64
_C.TRAIN.EPOCHES = 120
_C.TRAIN.LR = 0.05
_C.TRAIN.WEIGHT_DECAY = 5e-4
_C.TRAIN.TRIPLETLOSS = True
_C.TRAIN.MARGIN = 0.3
_C.TRAIN.DROPOUT = 0.5


# Loss
_C.LOSS = CN()
_C.LOSS.SMOOTH = False


# Optimize
_C.OPTIM = CN()
_C.OPTIM.LR = 'steplr'
_C.OPTIM.STEP_SIZE = 40
_C.OPTIM.MILSTONES = [40, 70]
_C.OPTIM.GAMMA = 0.1
_C.OPTIM.WARMUP_FACTOR = 1.0 / 3
_C.OPTIM.WARMUP_ITERS = 5
_C.OPTIM.WARMUP_METHOD = "linear"
_C.OPTIM.LAST_EPOCH = -1


# Evaulate
_C.EVAL = CN()
_C.EVAL.DIST = 'cos'


# Re-rank
_C.RERANK = CN()
_C.RERANK.ENABLE = False
_C.RERANK.K1 = 20
_C.RERANK.K2 = 6
_C.RERANK.LAMBDA = 0.3


# Logs
_C.LOGS = CN()
_C.LOGS.INTERVAL = 1
_C.LOGS.DIR = 'logs'


# Checkpoints
_C.CHECKPOINTS = CN()
_C.CHECKPOINTS.INTERVAL = 10
_C.CHECKPOINTS.DIR = 'checkpoints'


# Test
_C.TEST = CN()
_C.TEST.ENABLE = True
_C.TEST.BATCHSIZE = 128
_C.TEST.CHECKPOINT = './default/checkpoints/resnet50_60.pth'

8cf649c786172c538ce71e43ca18104f864cf8cf
<mask token>

<mask token>
_C = CN()
_C.CONFIG = CN()
_C.CONFIG.SAVED_FILE = 'config.yaml'
_C.DATASET = CN()
_C.DATASET.NAME = 'market'
_C.DATASET.DATA_DIR = '/root/Market-1501-v15.09.15'
_C.DATASET.NUM_CLASS = 751
_C.INPUT = CN()
_C.INPUT.PIXEL_MEAN = [0.485, 0.456, 0.406]
_C.INPUT.PIXEL_STD = [0.229, 0.224, 0.225]
_C.INPUT.SIZE_TRAIN = [256, 128]
_C.INPUT.PADDING = 10
_C.INPUT.RE_PROB = 0.5
_C.INPUT.RANDOM_ERASING = False
_C.DATALOADER = CN()
_C.DATALOADER.NUM_WORKERS = 8
_C.DATALOADER.NUM_INSTANCE = 4
_C.MODEL = CN()
_C.MODEL.NAME = 'resnet50'
_C.MODEL.RESNET_STRIDE = 2
_C.TRAIN = CN()
_C.TRAIN.BATCHSIZE = 64
_C.TRAIN.EPOCHES = 120
_C.TRAIN.LR = 0.05
_C.TRAIN.WEIGHT_DECAY = 0.0005
_C.TRAIN.TRIPLETLOSS = True
_C.TRAIN.MARGIN = 0.3
_C.TRAIN.DROPOUT = 0.5
_C.LOSS = CN()
_C.LOSS.SMOOTH = False
_C.OPTIM = CN()
_C.OPTIM.LR = 'steplr'
_C.OPTIM.STEP_SIZE = 40
_C.OPTIM.MILSTONES = [40, 70]
_C.OPTIM.GAMMA = 0.1
_C.OPTIM.WARMUP_FACTOR = 1.0 / 3
_C.OPTIM.WARMUP_ITERS = 5
_C.OPTIM.WARMUP_METHOD = 'linear'
_C.OPTIM.LAST_EPOCH = -1
_C.EVAL = CN()
_C.EVAL.DIST = 'cos'
_C.RERANK = CN()
_C.RERANK.ENABLE = False
_C.RERANK.K1 = 20
_C.RERANK.K2 = 6
_C.RERANK.LAMBDA = 0.3
_C.LOGS = CN()
_C.LOGS.INTERVAL = 1
_C.LOGS.DIR = 'logs'
_C.CHECKPOINTS = CN()
_C.CHECKPOINTS.INTERVAL = 10
_C.CHECKPOINTS.DIR = 'checkpoints'
_C.TEST = CN()
_C.TEST.ENABLE = True
_C.TEST.BATCHSIZE = 128
_C.TEST.CHECKPOINT = './default/checkpoints/resnet50_60.pth'

from yacs.config import CfgNode as CN
_C = CN()
_C.CONFIG = CN()
_C.CONFIG.SAVED_FILE = 'config.yaml'
_C.DATASET = CN()
_C.DATASET.NAME = 'market'
_C.DATASET.DATA_DIR = '/root/Market-1501-v15.09.15'
_C.DATASET.NUM_CLASS = 751
_C.INPUT = CN()
_C.INPUT.PIXEL_MEAN = [0.485, 0.456, 0.406]
_C.INPUT.PIXEL_STD = [0.229, 0.224, 0.225]
_C.INPUT.SIZE_TRAIN = [256, 128]
_C.INPUT.PADDING = 10
_C.INPUT.RE_PROB = 0.5
_C.INPUT.RANDOM_ERASING = False
_C.DATALOADER = CN()
_C.DATALOADER.NUM_WORKERS = 8
_C.DATALOADER.NUM_INSTANCE = 4
_C.MODEL = CN()
_C.MODEL.NAME = 'resnet50'
_C.MODEL.RESNET_STRIDE = 2
_C.TRAIN = CN()
_C.TRAIN.BATCHSIZE = 64
_C.TRAIN.EPOCHES = 120
_C.TRAIN.LR = 0.05
_C.TRAIN.WEIGHT_DECAY = 0.0005
_C.TRAIN.TRIPLETLOSS = True
_C.TRAIN.MARGIN = 0.3
_C.TRAIN.DROPOUT = 0.5
_C.LOSS = CN()
_C.LOSS.SMOOTH = False
_C.OPTIM = CN()
_C.OPTIM.LR = 'steplr'
_C.OPTIM.STEP_SIZE = 40
_C.OPTIM.MILSTONES = [40, 70]
_C.OPTIM.GAMMA = 0.1
_C.OPTIM.WARMUP_FACTOR = 1.0 / 3
_C.OPTIM.WARMUP_ITERS = 5
_C.OPTIM.WARMUP_METHOD = 'linear'
_C.OPTIM.LAST_EPOCH = -1
_C.EVAL = CN()
_C.EVAL.DIST = 'cos'
_C.RERANK = CN()
_C.RERANK.ENABLE = False
_C.RERANK.K1 = 20
_C.RERANK.K2 = 6
_C.RERANK.LAMBDA = 0.3
_C.LOGS = CN()
_C.LOGS.INTERVAL = 1
_C.LOGS.DIR = 'logs'
_C.CHECKPOINTS = CN()
_C.CHECKPOINTS.INTERVAL = 10
_C.CHECKPOINTS.DIR = 'checkpoints'
_C.TEST = CN()
_C.TEST.ENABLE = True
_C.TEST.BATCHSIZE = 128
_C.TEST.CHECKPOINT = './default/checkpoints/resnet50_60.pth'

from yacs.config import CfgNode as CN

_C = CN()

_C.CONFIG = CN()
_C.CONFIG.SAVED_FILE = 'config.yaml'

# Dasaset
_C.DATASET = CN()
_C.DATASET.NAME = 'market'
_C.DATASET.DATA_DIR = '/root/Market-1501-v15.09.15'
_C.DATASET.NUM_CLASS = 751


# Input
_C.INPUT = CN()
_C.INPUT.PIXEL_MEAN = [0.485, 0.456, 0.406]
_C.INPUT.PIXEL_STD = [0.229, 0.224, 0.225]
_C.INPUT.SIZE_TRAIN = [256, 128]
_C.INPUT.PADDING = 10
_C.INPUT.RE_PROB = 0.5
_C.INPUT.RANDOM_ERASING = False


# Dataloader
_C.DATALOADER = CN()
_C.DATALOADER.NUM_WORKERS = 8
_C.DATALOADER.NUM_INSTANCE = 4


## MODEL
_C.MODEL = CN()
_C.MODEL.NAME = 'resnet50'
_C.MODEL.RESNET_STRIDE = 2


# Train
_C.TRAIN = CN()
_C.TRAIN.BATCHSIZE = 64
_C.TRAIN.EPOCHES = 120
_C.TRAIN.LR = 0.05
_C.TRAIN.WEIGHT_DECAY = 5e-4
_C.TRAIN.TRIPLETLOSS = True
_C.TRAIN.MARGIN = 0.3
_C.TRAIN.DROPOUT = 0.5


# Loss
_C.LOSS = CN()
_C.LOSS.SMOOTH = False


# Optimize
_C.OPTIM = CN()
_C.OPTIM.LR = 'steplr'
_C.OPTIM.STEP_SIZE = 40
_C.OPTIM.MILSTONES = [40, 70]
_C.OPTIM.GAMMA = 0.1
_C.OPTIM.WARMUP_FACTOR = 1.0 / 3
_C.OPTIM.WARMUP_ITERS = 5
_C.OPTIM.WARMUP_METHOD = "linear"
_C.OPTIM.LAST_EPOCH = -1


# Evaulate
_C.EVAL = CN()
_C.EVAL.DIST = 'cos'


# Re-rank
_C.RERANK = CN()
_C.RERANK.ENABLE = False
_C.RERANK.K1 = 20
_C.RERANK.K2 = 6
_C.RERANK.LAMBDA = 0.3


# Logs
_C.LOGS = CN()
_C.LOGS.INTERVAL = 1
_C.LOGS.DIR = 'logs'


# Checkpoints
_C.CHECKPOINTS = CN()
_C.CHECKPOINTS.INTERVAL = 10
_C.CHECKPOINTS.DIR = 'checkpoints'


# Test
_C.TEST = CN()
_C.TEST.ENABLE = True
_C.TEST.BATCHSIZE = 128
_C.TEST.CHECKPOINT = './default/checkpoints/resnet50_60.pth'
