From 0a6a6522991036f460c43c8d2e9be8495ba514de Mon Sep 17 00:00:00 2001 From: ChengZi Date: Fri, 3 Feb 2023 14:51:36 +0800 Subject: [PATCH] update readme with dc2 --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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