From f690ed3f78dc3004d33b573385154bdf43b52a6b Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Fri, 24 Mar 2023 15:33:02 +0800 Subject: [PATCH] add audio_embedding_vggish.py Signed-off-by: shiyu22 --- audio_embedding_vggish.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 audio_embedding_vggish.py diff --git a/audio_embedding_vggish.py b/audio_embedding_vggish.py new file mode 100644 index 0000000..3442a8f --- /dev/null +++ b/audio_embedding_vggish.py @@ -0,0 +1,10 @@ +from towhee import pipe, ops, AutoPipes + +@AutoPipes.register +def AudioEmbeddingVggish(): + return ( + pipe.input('path') + .map('path', 'frame', ops.audio_decode.ffmpeg()) + .map('frame', 'vec', ops.audio_embedding.vggish()) + .output('vec') + ) \ No newline at end of file