Browse Source
change data2vec_audio to data2vec.
Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb
3 years ago
2 changed files with
4 additions and
6 deletions
-
README.md
-
__init__.py
|
|
@ -28,12 +28,11 @@ import towhee |
|
|
|
towhee.glob('test.wav') |
|
|
|
.audio_decode.ffmpeg() |
|
|
|
.runas_op(func=lambda x:[y[0] for y in x]) |
|
|
|
.towhee.data2vec_audio() |
|
|
|
.towhee.data2vec() |
|
|
|
.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:* |
|
|
|
|
|
|
@ -44,11 +43,10 @@ import towhee |
|
|
|
towhee.glob['path']('test.wav') |
|
|
|
.audio_decode.ffmpeg['path', 'frames']() |
|
|
|
.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() |
|
|
|
) |
|
|
|
``` |
|
|
|
<img src="https://towhee.io/towhee/data2vec-vision/raw/branch/main/result2.png" alt="result2" style="height:60px;"/> |
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
@ -59,7 +57,7 @@ import towhee |
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
|
|
|
|
|
***data2vec_vision(model_name='facebook/data2vec-vision-base')*** |
|
|
|
***data2vec(model_name='facebook/data2vec-audio-base')*** |
|
|
|
|
|
|
|
**Parameters:** |
|
|
|
|
|
|
|
|
|
@ -14,5 +14,5 @@ |
|
|
|
|
|
|
|
from .data2vec_audio import Data2VecAudio |
|
|
|
|
|
|
|
def data2vec_audio(model_name="facebook/data2vec-audio-base-960h"): |
|
|
|
def data2vec(model_name="facebook/data2vec-audio-base-960h"): |
|
|
|
return Data2VecAudio(model_name) |
|
|
|