reid.models

reid.models.create(name, *args, **kwargs)[source]

Create a model instance.

Parameters:
  • name (str) – Model name. Can be one of ‘inception’, ‘resnet18’, ‘resnet34’, ‘resnet50’, ‘resnet101’, and ‘resnet152’.
  • pretrained (bool, optional) – Only applied for ‘resnet*’ models. If True, will use ImageNet pretrained model. Default: True
  • cut_at_pooling (bool, optional) – If True, will cut the model before the last global pooling layer and ignore the remaining kwargs. Default: False
  • num_features (int, optional) – If positive, will append a Linear layer after the global pooling layer, with this number of output units, followed by a BatchNorm layer. Otherwise these layers will not be appended. Default: 256 for ‘inception’, 0 for ‘resnet*’
  • norm (bool, optional) – If True, will normalize the feature to be unit L2-norm for each sample. Otherwise will append a ReLU layer after the above Linear layer if num_features > 0. Default: False
  • dropout (float, optional) – If positive, will append a Dropout layer with this dropout rate. Default: 0
  • num_classes (int, optional) – If positive, will append a Linear layer at the end as the classifier with this number of output units. Default: 0
reid.models.inception(**kwargs)[source]
reid.models.resnet18(**kwargs)[source]
reid.models.resnet34(**kwargs)[source]
reid.models.resnet50(**kwargs)[source]
reid.models.resnet101(**kwargs)[source]
reid.models.resnet152(**kwargs)[source]
class reid.models.InceptionNet(cut_at_pooling=False, num_features=256, norm=False, dropout=0, num_classes=0)[source]
class reid.models.ResNet(depth, pretrained=True, cut_at_pooling=False, num_features=0, norm=False, dropout=0, num_classes=0)[source]