towhee.models.clip.clip.create_model

towhee.models.clip.clip.create_model(model_name: Optional[str] = None, pretrained: bool = False, weights_path: Optional[str] = None, jit: bool = False, device: Optional[str] = None, **kwargs) CLIP[source]

Create a CLIP model. :param model_name: CLIP model name, can be one of ‘clip_resnet_r50’, ‘clip_resnet_r101’, ‘clip_vit_b16’, ‘clip_vit_b32’ :type model_name: str :param pretrained: Whether to load pretrained weights. :type pretrained: bool :param weights_path: Path to the weights file. :type weights_path: str :param jit: Whether returned one is a jit model, only useful when pretrained is True. :type jit: bool :param device: Model device to use. :type device: str :param **kwargs: Extra arguments to pass to the model. :type **kwargs: dict

Returns:

The CLIP model.

Return type:

model (CLIP)

>>> from towhee.models import clip
>>> model = clip.create_model("clip_resnet_r50")
>>> model.__class__.__name__
'CLIP'