|
@ -28,12 +28,11 @@ import towhee |
|
|
towhee.glob('test.wav') |
|
|
towhee.glob('test.wav') |
|
|
.audio_decode.ffmpeg() |
|
|
.audio_decode.ffmpeg() |
|
|
.runas_op(func=lambda x:[y[0] for y in x]) |
|
|
.runas_op(func=lambda x:[y[0] for y in x]) |
|
|
.towhee.data2vec_audio() |
|
|
|
|
|
|
|
|
.towhee.data2vec() |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
``` |
|
|
``` |
|
|
<img src="https://towhee.io/towhee/data2vec-vision/raw/branch/main/result1.png" alt="result1" style="height:20px;"/> |
|
|
|
|
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
@ -44,11 +43,10 @@ import towhee |
|
|
towhee.glob['path']('test.wav') |
|
|
towhee.glob['path']('test.wav') |
|
|
.audio_decode.ffmpeg['path', 'frames']() |
|
|
.audio_decode.ffmpeg['path', 'frames']() |
|
|
.runas_op['frames', 'frames'](func=lambda x:[y[0] for y in x]) |
|
|
.runas_op['frames', 'frames'](func=lambda x:[y[0] for y in x]) |
|
|
.towhee.data2vec_audio['frames', 'vecs'](model_name="facebook/data2vec-audio-base-960h") |
|
|
|
|
|
|
|
|
.towhee.data2vec['frames', 'vecs'](model_name="facebook/data2vec-audio-base-960h") |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
|
``` |
|
|
``` |
|
|
<img src="https://towhee.io/towhee/data2vec-vision/raw/branch/main/result2.png" alt="result2" style="height:60px;"/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
<br /> |
|
@ -59,7 +57,7 @@ import towhee |
|
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
Create the operator via the following factory method |
|
|
|
|
|
|
|
|
***data2vec_vision(model_name='facebook/data2vec-vision-base')*** |
|
|
|
|
|
|
|
|
***data2vec(model_name='facebook/data2vec-audio-base')*** |
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
**Parameters:** |
|
|
|
|
|
|
|
|