logo
Browse Source

Update readme with new pipe

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 1 year ago
parent
commit
844033355f
  1. 27
      README.md
  2. 0
      result.png
  3. BIN
      result1.png

27
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')
)
```
<img src="./result1.png" width="800px"/>
*Write a same pipeline with explicit inputs/outputs name specifications:*
DataCollection(p('test.wav')).show()
```
<img src="./result.png" width="800px"/>
- option 2:
```python
import towhee
@ -48,8 +49,6 @@ import towhee
.show()
)
```
<img src="./result2.png" width="800px"/>
<br />
## Factory Constructor

0
result2.png → result.png

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
result1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Loading…
Cancel
Save