|
@ -28,11 +28,11 @@ import towhee |
|
|
|
|
|
|
|
|
towhee.glob('./teddy.jpg') \ |
|
|
towhee.glob('./teddy.jpg') \ |
|
|
.image_decode() \ |
|
|
.image_decode() \ |
|
|
.towhee.clip(model_name='ViT-B/32', modality='image') \ |
|
|
|
|
|
|
|
|
.towhee.clip(model_name='clip_vit_b32', modality='image') \ |
|
|
.show() |
|
|
.show() |
|
|
|
|
|
|
|
|
towhee.dc(["A teddybear on a skateboard in Times Square."]) \ |
|
|
towhee.dc(["A teddybear on a skateboard in Times Square."]) \ |
|
|
.towhee.clip(model_name='ViT-B/32', modality='text') \ |
|
|
|
|
|
|
|
|
.towhee.clip(model_name='clip_vit_b32', modality='text') \ |
|
|
.show() |
|
|
.show() |
|
|
``` |
|
|
``` |
|
|
<img src="https://towhee.io/towhee/clip/raw/branch/main/vec1.png" alt="result1" style="height:20px;"/> |
|
|
<img src="https://towhee.io/towhee/clip/raw/branch/main/vec1.png" alt="result1" style="height:20px;"/> |
|
@ -45,12 +45,12 @@ import towhee |
|
|
|
|
|
|
|
|
towhee.glob['path']('./teddy.jpg') \ |
|
|
towhee.glob['path']('./teddy.jpg') \ |
|
|
.image_decode['path', 'img']() \ |
|
|
.image_decode['path', 'img']() \ |
|
|
.towhee.clip['img', 'vec'](model_name='ViT-B/32', modality='image') \ |
|
|
|
|
|
|
|
|
.towhee.clip['img', 'vec'](model_name='clip_vit_b32', modality='image') \ |
|
|
.select['img', 'vec']() \ |
|
|
.select['img', 'vec']() \ |
|
|
.show() |
|
|
.show() |
|
|
|
|
|
|
|
|
towhee.dc['text'](["A teddybear on a skateboard in Times Square."]) \ |
|
|
towhee.dc['text'](["A teddybear on a skateboard in Times Square."]) \ |
|
|
.towhee.clip['text','vec'](model_name='ViT-B/32', modality='text') \ |
|
|
|
|
|
|
|
|
.towhee.clip['text','vec'](model_name='clip_vit_b32', modality='text') \ |
|
|
.select['text', 'vec']() \ |
|
|
.select['text', 'vec']() \ |
|
|
.show() |
|
|
.show() |
|
|
``` |
|
|
``` |
|
|