logo
Browse Source

update readme with dc2

main
ChengZi 2 years ago
parent
commit
e5612a2d30
  1. 26
      README.md

26
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)

Loading…
Cancel
Save