towhee.models.visualization.clip_visualization.show_attention_for_clip

towhee.models.visualization.clip_visualization.show_attention_for_clip(model: ~torch.nn.modules.module.Module, pil_img: <module 'PIL.Image' from '/home/docs/checkouts/readthedocs.org/user_builds/towhee/envs/main/lib/python3.9/site-packages/PIL/Image.py'>, text_list: ~typing.List[str], device: ~typing.Optional[str] = None)[source]

Show the attention for CLIP model. This function can show one image with multiple texts. :param model: CLIP model to show attention. :type model: nn.Module :param pil_img: Image to show. :type pil_img: Image :param text_list: Text list to show. :type text_list: List[str] :param device: Device to use. :type device: str