videoanalysis: prevent snapshot throttling when its only a single camera

This commit is contained in:
Koushik Dutta
2023-06-11 09:13:05 -07:00
parent 1b5565b5b2
commit ea6e33d159
3 changed files with 7 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.141",
"version": "0.0.142",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/objectdetector",
"version": "0.0.141",
"version": "0.0.142",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.141",
"version": "0.0.142",
"description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -991,6 +991,10 @@ class ObjectDetectionPlugin extends AutoenableMixinProvider implements Settings,
shouldUseSnapshotPipeline() {
this.pruneOldStatistics();
// never use snapshot mode if its a single camera.
if (this.statsSnapshotConcurrent < 2)
return false;
// find any concurrent cameras with as many or more that had passable results
for (const [k, v] of this.objectDetectionStatistics.entries()) {
if (v.dps > 2 && k >= this.statsSnapshotConcurrent)