towhee.models.mpvit.mpvit.create_model

towhee.models.mpvit.mpvit.create_model(model_name: Optional[str] = None, num_classes: int = 1000, pretrained: bool = False, weights_path: Optional[str] = None, device: Optional[str] = None) MPViT[source]

Create MViT model. :param model_name: Name of MPViT model, it can be mpvit_tiny, mpvit_xsmall, mpvit_small or mpvit_base. :type model_name: str :param num_classes: Classification head in the model, default is 1000, for the default pretrained model is pretrained in ImageNet1k. :type num_classes: int :param pretrained: Whether the model using pretrained weights, default is None. :type pretrained: bool :param weights_path: Local weights path. :type weights_path: str :param device: Model device, cpu or cuda :type device: str

Returns:

(MPViT)

MPViT model.

>>> from towhee.models import mpvit
>>> model = mpvit.create_model('mpvit_tiny')
>>> model.__class__.__name__
'MPViT'