diff --git a/README.md b/README.md index a83a693..3e89cfd 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,20 @@ This operator can compare two ordered sequences, then detect the range which fea ```python -import towhee +from towhee.dc2 import pipe, ops, DataCollection import numpy as np # simulate a video feature by 10 frames of 512d vectors. videos_embeddings = np.random.randn(10,512) videos_embeddings = videos_embeddings / np.linalg.norm(videos_embeddings,axis=1).reshape(10,-1) -towhee.dc['src','dest']([[videos_embeddings,videos_embeddings]]) \ - .video_copy_detection.temporal_network[('src','dest'), ('range', 'range_score')]() \ - .show() +p = ( + pipe.input('src', 'dest') \ + .map(('src', 'dest'), ('range', 'range_score'), ops.video_copy_detection.temporal_network()) \ + .output('src', 'dest', 'range', 'range_score') +) + +DataCollection(p(videos_embeddings, videos_embeddings)).show() ``` result