Esempio n. 1
0
def add_kdreid_config(cfg):
    _C = cfg

    _C.MODEL_TEACHER = CN()
    _C.MODEL_TEACHER.META_ARCHITECTURE = 'Baseline'

    # ---------------------------------------------------------------------------- #
    # teacher model Backbone options
    # ---------------------------------------------------------------------------- #
    _C.MODEL_TEACHER.BACKBONE = CN()

    _C.MODEL_TEACHER.BACKBONE.NAME = "build_resnet_backbone"
    _C.MODEL_TEACHER.BACKBONE.DEPTH = "50x"
    _C.MODEL_TEACHER.BACKBONE.LAST_STRIDE = 1
    # If use IBN block in backbone
    _C.MODEL_TEACHER.BACKBONE.WITH_IBN = False
    # If use SE block in backbone
    _C.MODEL_TEACHER.BACKBONE.WITH_SE = False
    # If use Non-local block in backbone
    _C.MODEL_TEACHER.BACKBONE.WITH_NL = False

    # for shufflenet
    _C.MODEL_TEACHER.BACKBONE.MODEL_SIZE = '1.0x'

    #
    _C.MODEL_TEACHER.BACKBONE.NORM = 'BN'
    _C.MODEL_TEACHER.BACKBONE.PRETRAIN = False

    # ---------------------------------------------------------------------------- #
    # teacher model HEADS options
    # ---------------------------------------------------------------------------- #
    _C.MODEL_TEACHER.HEADS = CN()
    _C.MODEL_TEACHER.HEADS.NAME = "BNneckHead"

    # Input feature dimension
    _C.MODEL_TEACHER.HEADS.IN_FEAT = 2048
    _C.MODEL_TEACHER.HEADS.REDUCTION_DIM = 256
    # Pooling layer type
    _C.MODEL_TEACHER.HEADS.POOL_LAYER = "avgpool"
    _C.MODEL_TEACHER.HEADS.NECK_FEAT = "before"
    _C.MODEL_TEACHER.HEADS.CLS_LAYER = "linear"

    # Pretrained teacher and student model weights
    _C.MODEL.TEACHER_WEIGHTS = ""
    _C.MODEL.STUDENT_WEIGHTS = ""

    #
    _C.MODEL_TEACHER.HEADS.NORM = 'BN'
    _C.MODEL_TEACHER.HEADS.SCALE = 64
    _C.MODEL_TEACHER.HEADS.MARGIN = 0.35
Esempio n. 2
0
def add_attr_config(cfg):
    _C = cfg

    _C.MODEL.LOSSES.BCE = CN({"WEIGHT_ENABLED": True})
    _C.MODEL.LOSSES.BCE.SCALE = 1.

    _C.TEST.THRES = 0.5
Esempio n. 3
0
def add_face_cfg(cfg):
    _C = cfg

    _C.DATASETS.REC_PATH = ""

    _C.MODEL.HEADS.PFC = CN({"ENABLED": False})
    _C.MODEL.HEADS.PFC.SAMPLE_RATE = 0.1
Esempio n. 4
0
def add_ARI_eval_config(cfg):
    _C = cfg

    # -----------------------------------------------------------------------------
    # Cluster
    # -----------------------------------------------------------------------------
    _C.CLUSTER = CN()
    _C.CLUSTER.METHOD = "DBSCAN"

    _C.CLUSTER.DBSCAN = CN()
    _C.CLUSTER.DBSCAN.ADAPTIVE_EPS = False
    _C.CLUSTER.DBSCAN.EPS = 0.6

    # hyperparameter for jaccard distance.
    _C.CLUSTER.JACCARD = CN()
    _C.CLUSTER.JACCARD.K1 = 30
    _C.CLUSTER.JACCARD.K2 = 6
Esempio n. 5
0
def add_memory_config(cfg):
    _C = cfg

    # -----------------------------------------------------------------------------
    # Memory
    # -----------------------------------------------------------------------------
    _C.MEMORY = CN()
    _C.MEMORY.TEMP = 0.05
    _C.MEMORY.MOMENTUM = 0.2
Esempio n. 6
0
def add_my_baseline_config(cfg):
    _C = cfg

    # -----------------------------------------------------------------------------
    # Losses
    # -----------------------------------------------------------------------------
    # Center Loss
    _C.MODEL.LOSSES.CENTER = CN()
    _C.MODEL.LOSSES.CENTER.NUM_CLASSES = 0
    _C.MODEL.LOSSES.CENTER.FEAT_DIM = 2048
    _C.MODEL.LOSSES.CENTER.SCALE = 0.0005
Esempio n. 7
0
def add_cross_domain_baseline_config(cfg):
    _C = cfg

    # -----------------------------------------------------------------------------
    # Cluster
    # -----------------------------------------------------------------------------
    _C.CLUSTER = CN()
    _C.CLUSTER.METHOD = "DBSCAN"

    _C.CLUSTER.DBSCAN = CN()
    _C.CLUSTER.DBSCAN.ADAPTIVE_EPS = False
    _C.CLUSTER.DBSCAN.EPS = 0.6
    # _C.CLUSTER.DBSCAN.EPS = 0.2
    _C.CLUSTER.DBSCAN.EPS_GAP = 0.02

    # hyperparameter for jaccard distance.
    _C.CLUSTER.JACCARD = CN()
    _C.CLUSTER.JACCARD.K1 = 30
    _C.CLUSTER.JACCARD.K2 = 6

    # -----------------------------------------------------------------------------
    # Dataset
    # -----------------------------------------------------------------------------
    # source domain
    _C.DATASETS.SRC = "DukeMTMC"
    # target domain
    _C.DATASETS.TGT = "Market1501"

    # -----------------------------------------------------------------------------
    # Model
    # -----------------------------------------------------------------------------
    _C.MODEL.PRETRAIN = False
    _C.MODEL.PRETRAIN_PATH = ''
    _C.MODEL.IGNORE_LAYERS = []

    # -----------------------------------------------------------------------------
    # Solver
    # -----------------------------------------------------------------------------
    _C.SOLVER.ITERS = 400
    _C.SOLVER.RHO = 1.6e-3
Esempio n. 8
0
def add_partialreid_config(cfg):
    _C = cfg

    _C.TEST.DSR = CN()
    _C.TEST.DSR.ENABLED = True
    _C.TEST.DSR.TOPK = 30
Esempio n. 9
0
def add_partialreid_config(cfg):
    _C = cfg

    _C.TEST.DSR = CN({"ENABLED": True})