def EncoderImage(model_name, img_dim, embed_size, image_norm=True, cnn_type=None, finetune=False):
    """A wrapper to image encoders. Chooses between an different encoders
    that uses precomputed image features.
    """
    model_name = model_name.lower()
    EncoderMap = {
        'scan': EncoderImagePrecomp,
        'vsepp': EncoderImageFull,
        'sgraf': EncoderImagePrecomp,
        'imram': EncoderImagePrecomp,
        'bfan': EncoderImagePrecomp,
    }

    if model_name in EncoderMap:
        img_enc = EncoderMap[model_name](img_dim, embed_size, image_norm, cnn_type, finetune)
    else:
        raise ValueError("Unknown model: {}".format(model_name))

    return img_enc
A wrapper to image encoders. Chooses between an different encoders
    that uses precomputed image features.
    
torchmm/models/retrieval/layers/img_enc.py