|
@ -30,11 +30,11 @@ import towhee |
|
|
towhee.dc(['./demo_video.mp4']) \ |
|
|
towhee.dc(['./demo_video.mp4']) \ |
|
|
.video_decode.ffmpeg(sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \ |
|
|
.video_decode.ffmpeg(sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \ |
|
|
.runas_op(func=lambda x: [y for y in x]) \ |
|
|
.runas_op(func=lambda x: [y for y in x]) \ |
|
|
.drl(base_encoder='clip_vit_b32', modality='video', device='cpu') \ |
|
|
|
|
|
|
|
|
.video_text_embedding.drl(base_encoder='clip_vit_b32', modality='video', device='cpu') \ |
|
|
.show() |
|
|
.show() |
|
|
|
|
|
|
|
|
towhee.dc(['kids feeding and playing with the horse']) \ |
|
|
towhee.dc(['kids feeding and playing with the horse']) \ |
|
|
.drl(base_encoder='clip_vit_b32', modality='text', device='cpu') \ |
|
|
|
|
|
|
|
|
.video_text_embedding.drl(base_encoder='clip_vit_b32', modality='text', device='cpu') \ |
|
|
.show() |
|
|
.show() |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
@ -49,11 +49,11 @@ import towhee |
|
|
towhee.dc['path'](['./demo_video.mp4']) \ |
|
|
towhee.dc['path'](['./demo_video.mp4']) \ |
|
|
.video_decode.ffmpeg['path', 'frames'](sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \ |
|
|
.video_decode.ffmpeg['path', 'frames'](sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \ |
|
|
.runas_op['frames', 'frames'](func=lambda x: [y for y in x]) \ |
|
|
.runas_op['frames', 'frames'](func=lambda x: [y for y in x]) \ |
|
|
.drl['frames', 'vec'](base_encoder='clip_vit_b32', modality='video', device='cpu') \ |
|
|
|
|
|
|
|
|
.video_text_embedding.drl['frames', 'vec'](base_encoder='clip_vit_b32', modality='video', device='cpu') \ |
|
|
.show(formatter={'path': 'video_path'}) |
|
|
.show(formatter={'path': 'video_path'}) |
|
|
|
|
|
|
|
|
towhee.dc['text'](['kids feeding and playing with the horse']) \ |
|
|
towhee.dc['text'](['kids feeding and playing with the horse']) \ |
|
|
.drl['text','vec'](base_encoder='clip_vit_b32', modality='text', device='cpu') \ |
|
|
|
|
|
|
|
|
.video_text_embedding.drl['text','vec'](base_encoder='clip_vit_b32', modality='text', device='cpu') \ |
|
|
.select['text', 'vec']() \ |
|
|
.select['text', 'vec']() \ |
|
|
.show() |
|
|
.show() |
|
|
``` |
|
|
``` |
|
|