torchreid/models/__init__.py
def build_model(name, num_classes, loss='softmax', pretrained=True, use_gpu=True, backbone='resnet50'):
    """A function wrapper for building a model.

    Args:
        name (str): model name.
        num_classes (int): number of training identities.
        loss (str, optional): loss function to optimize the model. Currently
            supports "softmax" and "triplet". Default is "softmax".
        pretrained (bool, optional): whether to load ImageNet-pretrained weights.
            Default is True.
        use_gpu (bool, optional): whether to use gpu. Default is True.

    Returns:
        nn.Module

    Examples::
        >> from deepreid import models
        >> model = models.build_model('resnet50', 751, loss='softmax')
    """
    avai_models = list(__model_factory.keys())
    if name not in avai_models:
        raise KeyError('Unknown model: {}. Must be one of {}'.format(name, avai_models))
    return __model_factory[name](
        num_classes=num_classes,
        loss=loss,
        pretrained=pretrained,
        use_gpu=use_gpu,
        backbone=backbone,
    )
A function wrapper for building a model.

    Args:
        name (str): model name.
        num_classes (int): number of training identities.
        loss (str, optional): loss function to optimize the model. Currently
            supports "softmax" and "triplet". Default is "softmax".
        pretrained (bool, optional): whether to load ImageNet-pretrained weights.
            Default is True.
        use_gpu (bool, optional): whether to use gpu. Default is True.

    Returns:
        nn.Module

    Examples::
        >> from deepreid import models
        >> model = models.build_model('resnet50', 751, loss='softmax')
    
A function wrapper for building a model.
A function wrapper for building a model .
def build_model(name, num_classes, loss='softmax', pretrained=True, use_gpu=True, backbone='resnet50'):
    avai_models = list(__model_factory.keys())
    if name not in avai_models:
        raise KeyError('Unknown model: {}. Must be one of {}'.format(name, avai_models))
    return __model_factory[name](
        num_classes=num_classes,
        loss=loss,
        pretrained=pretrained,
        use_gpu=use_gpu,
        backbone=backbone,
    )
def build_model ( name , num_classes , loss = 'softmax' , pretrained = True , use_gpu = True , backbone = 'resnet50' ) : avai_models = list ( __model_factory . keys ( ) ) if name not in avai_models : raise KeyError ( 'Unknown model: {}. Must be one of {}' . format ( name , avai_models ) ) return __model_factory [ name ] ( num_classes = num_classes , loss = loss , pretrained = pretrained , use_gpu = use_gpu , backbone = backbone , )
A function wrapper for building a model.
A function wrapper for building a model .
"""A function wrapper for building a model.

    Args:
        name (str): model name.
        num_classes (int): number of training identities.
        loss (str, optional): loss function to optimize the model. Currently
            supports "softmax" and "triplet". Default is "softmax".
        pretrained (bool, optional): whether to load ImageNet-pretrained weights.
            Default is True.
        use_gpu (bool, optional): whether to use gpu. Default is True.

    Returns:
        nn.Module

    Examples::
        >> from deepreid import models
        >> model = models.build_model('resnet50', 751, loss='softmax')
    """
None
name
None
num_classes
number of training identities.
number of training identities .
loss
loss function to optimize the model. Currently
supports "softmax" and "triplet". Default is "softmax".
loss function to optimize the model . Currently supports " softmax " and " triplet " . Default is " softmax " .
pretrained
whether to load ImageNet-pretrained weights.
Default is True.
whether to load ImageNet - pretrained weights . Default is True .
use_gpu
whether to use gpu. Default is True.
whether to use gpu . Default is True .
backbone