From 844033355f5aee39c2ba1bf8c2a884b355d1b09b Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Wed, 28 Dec 2022 16:30:45 +0800 Subject: [PATCH] Update readme with new pipe Signed-off-by: Jael Gu --- README.md | 27 +++++++++++++-------------- result2.png => result.png | Bin result1.png | Bin 3863 -> 0 bytes 3 files changed, 13 insertions(+), 14 deletions(-) rename result2.png => result.png (100%) delete mode 100644 result1.png diff --git a/README.md b/README.md index 9ff543b..c454afc 100644 --- a/README.md +++ b/README.md @@ -17,25 +17,26 @@ The nnfp operator is suitable for audio fingerprinting. ## Code Example -Generate embeddings for the audio "test.wav". +Generate embeddings for the audio "test.wav". -*Write the pipeline in simplified style*: +*Write a same pipeline with explicit inputs/outputs name specifications:* +- option 1 (towhee>=0.9.0): ```python -import towhee +from towhee.dc2 import pipe, ops, DataCollection -( - towhee.glob('test.wav') - .audio_decode.ffmpeg() - .runas_op(func=lambda x:[y[0] for y in x]) - .audio_embedding.nnfp() # use default model - .show() +p = ( + pipe.input('path') + .map('path', 'frame', ops.audio_decode.ffmpeg()) + .map('frame', 'vecs', ops.audio_embedding.nnfp(device='cpu')) + .output('path', 'vecs') ) -``` - -*Write a same pipeline with explicit inputs/outputs name specifications:* +DataCollection(p('test.wav')).show() +``` + +- option 2: ```python import towhee @@ -48,8 +49,6 @@ import towhee .show() ) ``` - -
## Factory Constructor diff --git a/result2.png b/result.png similarity index 100% rename from result2.png rename to result.png diff --git a/result1.png b/result1.png deleted file mode 100644 index 5bbbf1a245edc9812e413578f7f0389dee7f9164..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3863 zcmZ8kc{mhm`yL!bsFT7Njj|+~kbRj*$i8G}Oe1R<6HUf4Bav*`x9p{&kQrNclR-ip zJ44e<%Ve3vNQ}%_e$F}Hb^X5U`{#M?_x5+L-Q*(ATg@R)e*9lMHjTckcZ8kF9*DfEkN;=QyIP<6hS#o@G*mq&OGkm14 zWUzGT{mA;vr{-_JONe%l_jB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