話題のOpenAIの新たな画像分類モデルCLIPを論文から徹底解説! | DeepSquare
This is the Image & Text model CLIP, which maps text and images to a shared vector space. For applications of the models https://huggingface.co/sentence-transformers/clip-ViT-L-14 clip-ViT-L-14
49408 BOS=49406 EOS=49407 python
>>> clip.tokenize("a painting of a cat")
tensor([49406, 320, 3086, 539, 320, 2368, 49407, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0](/ja/49406%2C%20%20%20320%2C%20%203086%2C%20%20%20539%2C%20%20%20320%2C%20%202368%2C%2049407%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200), dtype=torch.int32)
subwords python
>>> clip.tokenize("bozuman")
tensor([49406, 647, 4091, 786, 49407, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0](/ja/49406%2C%20%20%20647%2C%20%204091%2C%20%20%20786%2C%2049407%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200%2C%20%20%20%20%200), dtype=torch.int32)