|
@ -17,20 +17,30 @@ This operator can filter tiny detected segments with format of list of `[start_s |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```python |
|
|
```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) |
|
|
![](result.png) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```python |
|
|
```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) |
|
|
![](result2.png) |
|
|
|
|
|
|
|
|