Filters
There are several types of object filters that can be used to reduce false positive rates.
Object Scores
For object filters in your configuration, any single detection below min_score
will be ignored as a false positive. threshold
is based on the median of the history of scores (padded to 3 values) for a tracked object. Consider the following frames when min_score
is set to 0.6 and threshold is set to 0.85:
Frame | Current Score | Score History | Computed Score | Detected Object |
---|---|---|---|---|
1 | 0.7 | 0.0, 0, 0.7 | 0.0 | No |
2 | 0.55 | 0.0, 0.7, 0.0 | 0.0 | No |
3 | 0.85 | 0.7, 0.0, 0.85 | 0.7 | No |
4 | 0.90 | 0.7, 0.85, 0.95, 0.90 | 0.875 | Yes |
5 | 0.88 | 0.7, 0.85, 0.95, 0.90, 0.88 | 0.88 | Yes |
6 | 0.95 | 0.7, 0.85, 0.95, 0.90, 0.88, 0.95 | 0.89 | Yes |
In frame 2, the score is below the min_score
value, so Frigate ignores it and it becomes a 0.0. The computed score is the median of the score history (padding to at least 3 values), and only when that computed score crosses the threshold
is the object marked as a true positive. That happens in frame 4 in the example.
Minimum Score
Any detection below min_score
will be immediately thrown out and never tracked because it is considered a false positive. If min_score
is too low then false positives may be detected and tracked which can confuse the object tracker and may lead to wasted resources. If min_score
is too high then lower scoring true positives like objects that are further away or partially occluded may be thrown out which can also confuse the tracker and cause valid tracked objects to be lost or disjointed.
Threshold
threshold
is used to determine that the object is a true positive. Once an object is detected with a score >= threshold
object is considered a true positive. If threshold
is too low then some higher scoring false positives may create an tracked object. If threshold
is too high then true positive tracked objects may be missed due to the object never scoring high enough.