def build_iresnet_backbone(cfg):
    """
    Create a IResNet instance from config.
    Returns:
        ResNet: a :class:`ResNet` instance.
    """

    # fmt: off
    bn_norm = cfg.MODEL.BACKBONE.NORM
    depth   = cfg.MODEL.BACKBONE.DEPTH
    dropout = cfg.MODEL.BACKBONE.DROPOUT
    fp16    = cfg.SOLVER.AMP.ENABLED
    # fmt: on

    num_blocks_per_stage = {
        '18x': [2, 2, 2, 2],
        '34x': [3, 4, 6, 3],
        '50x': [3, 4, 14, 3],
        '100x': [3, 13, 30, 3],
        '200x': [6, 26, 60, 6],
    }[depth]

    model = IResNet(IBasicBlock, num_blocks_per_stage, bn_norm, dropout, fp16=fp16)
    return model

    Create a IResNet instance from config.
    Returns:
        ResNet: a :class:`ResNet` instance.
    
projects/FastFace/fastface/modeling/iresnet.py