From e5612a2d30ddc054ec1b9a33e8f7914e15aee565 Mon Sep 17 00:00:00 2001 From: ChengZi Date: Thu, 2 Feb 2023 16:12:09 +0800 Subject: [PATCH] update readme with dc2 --- README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0572f94..fab6b71 100644 --- a/README.md +++ b/README.md @@ -17,20 +17,30 @@ This operator can filter tiny detected segments with format of list of `[start_s ```python -import towhee -towhee.dc['pred']([[[0, 0, 100, 100], [0, 0, 10, 10], [0, 0, 60, 10]]]) \ - .video_copy_detection.filter_tiny_segments['pred', 'filtered_pred'](filter_s_thresh=20) \ - .show() +from towhee.dc2 import pipe, ops, DataCollection + +p = ( + pipe.input('pred') \ + .map('pred', 'filtered_pred', ops.video_copy_detection.filter_tiny_segments(filter_s_thresh=20)) \ + .output('pred', 'filtered_pred') +) + +DataCollection(p([[0, 0, 100, 100], [0, 0, 10, 10], [0, 0, 60, 10]])).show() ``` ![](result.png) ```python -import towhee -towhee.dc['pred', 'sim_hw']([[[[0, 0, 10, 10]], [11, 11]]]) \ - .video_copy_detection.filter_tiny_segments[('pred', 'sim_hw'), 'filtered_pred'](filter_s_thresh=20) \ - .show() +from towhee.dc2 import pipe, ops, DataCollection + +p = ( + pipe.input('pred', 'sim_hw') \ + .map(('pred', 'sim_hw'), 'filtered_pred', ops.video_copy_detection.filter_tiny_segments(filter_s_thresh=20)) \ + .output('pred', 'sim_hw', 'filtered_pred') +) + +DataCollection(p([[0, 0, 10, 10]], [11, 11])).show() ``` ![](result2.png)