# 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
```python
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()
```
![](result.png)
```python
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()
```
![](result2.png)
## 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
# More Resources
- [4 Steps to Building a Video Search System - Zilliz blog](https://zilliz.com/blog/building-video-search-system-with-milvus): Searching for videos by image with Milvus
- [Vector Similarity Search Hides in Plain View - Zilliz blog](https://zilliz.com/blog/Vector-Similarity-Search-Hides-in-Plain-View): Artificial intelligence influences what we read, the things we buy, who we become friends with, and more everyday human behavior. A huge part of what makes many modern AI applications possible is vector similarity search. Understanding how this underlying technology works can help demystify AI, providing insight into what computer intelligence is really made of.
- [Comparing SPLADE Sparse Vectors with BM25 - Zilliz blog](https://zilliz.com/learn/comparing-splade-sparse-vectors-with-bm25): In general, there are two types of vectors: dense vectors and sparse vectors. While they can be utilized for similar tasks, each has advantages and disadvantages. In this post, we will delve into two popular variants of sparse embedding: BM25 and SPLADE.
- [How to Best Fit Filtering into Vector Similarity Search? - Zilliz blog](https://zilliz.com/learn/attribute-filtering): Learn about three types of attribute filtering in vector similarity search and explore our optimized solution to improve the efficiency of similarity search.