logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

Updated 1 year ago

video-copy-detection

Filter Tiny Segments

author: Chen Zhang


Description

This operator can filter tiny detected segments with format of list of [start_second_1, start_second_2, end_second_1, end_second_2]

Code Example

from towhee 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()

from towhee 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()

Factory Constructor

Create the operator via the following factory method

filter_tiny_segments(filter_s_thresh, segment_len_rate)

Parameters:

filter_s_thresh: float

​ Use a thresh to filter detected box which is smaller than it.

segment_len_rate: float

​ Filter expect longer then segment_len_rate * video length. Only useful for filter expect near video length segments.


Interface

Parameters:

pred_value: List

​ List of predicted segment second infos of a video pair

sim_hw: Tuple

​ Similarity matrix height and weight of a video pair. If sample rate is 1s, sim_hw is also the lengths of these videos.

Returns:

res_pred_list: List

​ List of filtered predicted segment second infos

ChengZi 65562bc19a rm dc2 in readme 6 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 2 years ago
file-icon README.md
1.7 KiB
download-icon
rm dc2 in readme 1 year ago
file-icon __init__.py
764 B
download-icon
update __init__.py args 1 year ago
file-icon filter_tiny_segments.py
1.1 KiB
download-icon
filter_tiny_segments 2 years ago
file-icon result.png
11 KiB
download-icon
filter_tiny_segments 2 years ago
file-icon result2.png
28 KiB
download-icon
filter_tiny_segments add example 2 years ago