forked from cavalleria/cavaface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
71 lines (63 loc) · 3.23 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import torch
configurations = {
1: dict(
SEED = 1337, # random seed for reproduce results
DATA_ROOT = '../facedata.mxnet/glint360', # the parent root where your train/val/test data are stored
VAL_DATA_ROOT = '../facedata.mxnet/face_val_data', # the parent root where your val/test data are stored
VAL_SET = 'lfw, cfp_fp, agedb_30, vgg2_fp', # validation set name
MODEL_ROOT = '../models/face_models/IR100_Arcface_Glint360/model', # the root to buffer your checkpoints
LOG_ROOT = '../models/face_models/IR100_Arcface_Glint360/logs', # the root to log your train/val status
IS_RESUME = False,
BACKBONE_RESUME_ROOT = "",
HEAD_RESUME_ROOT = "",
BACKBONE_NAME = 'IR_100', # support: ['MobileFaceNet', 'ResNet_50', 'ResNet_101', 'ResNet_152',
#'IR_50', 'IR_101', 'IR_152', 'IR_SE_50', 'IR_SE_100', 'IR_SE_101', 'IR_SE_152',
#'AttentionNet_IR_56', 'AttentionNet_IRSE_56','AttentionNet_IR_92', 'AttentionNet_IRSE_92',
#'ResNeSt_50', 'ResNeSt_101', 'ResNeSt_100']
HEAD_NAME = "ArcFace", # support: ['Softmax', 'ArcFace', 'CosFace', 'SphereFace', 'Am_softmax', 'ArcNegFace', 'CurricularFace', 'SVX']
LOSS_NAME = 'Softmax', # support: [''Softmax', Focal', 'HardMining', 'LabelSmooth', 'Softplus']
INPUT_SIZE = [112, 112], # support: [112, 112] and [224, 224]
RGB_MEAN = [0.5, 0.5, 0.5], # for normalize inputs to [-1, 1]
RGB_STD = [0.5, 0.5, 0.5],
EMBEDDING_SIZE = 512, # feature dimension
BATCH_SIZE = 1024,
EVAL_FREQ = 2000, #for ms1m, batch size 1024, EVAL_FREQ=2000
DROP_LAST = True, # whether drop the last batch to ensure consistent batch_norm statistics
OPTIMIZER = 'sgd', # sgd, adam, lookahead, radam, ranger, adamp, sgdp
LR = 0.1, # initial LR, use smaller lr for adam seris
LR_SCHEDULER = 'cosine', # step/multi_step/cosine
WARMUP_EPOCH = 0,
WARMUP_LR = 0.0,
START_EPOCH = 0, # start epoch
NUM_EPOCH = 16, # total epoch number
LR_STEP_SIZE = 10, # 'step' scheduler, period of learning rate decay.
LR_DECAY_EPOCH = [10, 18, 22], # ms1m epoch stages to decay learning rate
LR_DECAT_GAMMA = 0.1, # multiplicative factor of learning rate decay
LR_END = 1e-5, # minimum learning rate
WEIGHT_DECAY = 5e-4, # do not apply to batch_norm parameters
MOMENTUM = 0.9,
WORLD_SIZE = 1,
RANK = 0,
GPU = [0,1,2,3,4,5,6,7], # specify your GPU id
DIST_BACKEND = 'nccl', # 'nccl', 'gloo'
DIST_URL = 'tcp://localhost:23456',
NUM_WORKERS = 2,
TEST_GPU_ID = [0,1,2,3,4,5,6,7],
USE_APEX = True,
OPT_LEVEL = 'O1',
SYNC_BN = False,
# Data Augmentation
RANDAUGMENT = False,
RANDAUGMENT_N = 2, # random pick numer of aug typr form aug_list
RANDAUGMENT_M = 9,
RANDOM_ERASING = False,
MIXUP = False,
MIXUP_ALPHA = 1.0,
MIXUP_PROB = 0.5,
CUTOUT = False,
CUTMIX = False,
CUTMIX_ALPHA = 1.0,
CUTMIX_PROB = 0.5,
COLORJITTER = False
),
}