From 6e79a5402e8eca31d5ee1badc1931092321a376b Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 17 Sep 2020 07:36:40 -0500 Subject: [PATCH] Readme updates --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 2873d40e0..1c12c4d35 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,20 @@ Same as `frigate//events/start`, but with an `end_time` property as ### frigate// Publishes `ON` or `OFF` and is designed to be used a as a binary sensor in HomeAssistant for whether or not that object type is detected in the zone. +## Understanding min_score and threshold +`min_score` defines the minimum score for Frigate to begin tracking a detected object. Any single detection below `min_score` will be ignored as a false positive. `threshold` is based on the median of the history of scores 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. + ## Using a custom model or labels Models for both CPU and EdgeTPU (Coral) are bundled in the image. You can use your own models with volume mounts: - CPU Model: `/cpu_model.tflite`