Browse Source
Debug
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
2 changed files with
2 additions and
11 deletions
-
README.md
-
vggish.py
|
@ -26,6 +26,7 @@ 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]) |
|
|
.audio_embedding.vggish() |
|
|
.audio_embedding.vggish() |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
@ -40,6 +41,7 @@ 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]) |
|
|
.audio_embedding.vggish['frames', 'vecs']() |
|
|
.audio_embedding.vggish['frames', 'vecs']() |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
|
|
@ -71,14 +71,3 @@ class Vggish(NNOperator): |
|
|
log.error("Fail to load audio data.") |
|
|
log.error("Fail to load audio data.") |
|
|
raise e |
|
|
raise e |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if __name__ == '__main__': |
|
|
|
|
|
# encoder = Vggish() |
|
|
|
|
|
# |
|
|
|
|
|
# # audio_path = '/path/to/audio' |
|
|
|
|
|
# # vec = encoder(audio_path) |
|
|
|
|
|
# |
|
|
|
|
|
# audio_data = numpy.zeros((2, 441344)) |
|
|
|
|
|
# sample_rate = 44100 |
|
|
|
|
|
# vec = encoder(audio_data, sample_rate) |
|
|
|
|
|
# print(vec) |
|
|
|
|
|