pyiqa.archs.afineclip_model =========================== .. py:module:: pyiqa.archs.afineclip_model Module Contents --------------- .. py:function:: available_models() -> List[str] Returns the names of available CLIP models .. py:function:: load(name: str, device: Union[str, torch.device] = 'cuda' if torch.cuda.is_available() else 'cpu', jit: bool = False, download_root: str = None) Load a CLIP model :param name: A model name listed by `clip.available_models()`, or the path to a model checkpoint containing the state_dict :type name: str :param device: The device to put the loaded model :type device: Union[str, torch.device] :param jit: Whether to load the optimized JIT model or more hackable non-JIT model (default). :type jit: bool :param download_root: path to download the model files; by default, it uses "~/.cache/clip" :type download_root: str :returns: * **model** (*torch.nn.Module*) -- The CLIP model * **preprocess** (*Callable[[PIL.Image], torch.Tensor]*) -- A torchvision transform that converts a PIL image into a tensor that the returned model can take as its input