From 79f4c27bedcd13a4d7d11d089d09ddc614c987fd Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 18 Feb 2024 08:45:19 -0800 Subject: [PATCH] videoanalysis: more cpu throttling fixes --- plugins/objectdetector/package-lock.json | 4 ++-- plugins/objectdetector/package.json | 2 +- plugins/objectdetector/src/main.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/objectdetector/package-lock.json b/plugins/objectdetector/package-lock.json index c3ecadc4a..db2e72a0d 100644 --- a/plugins/objectdetector/package-lock.json +++ b/plugins/objectdetector/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/objectdetector", - "version": "0.1.26", + "version": "0.1.27", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/objectdetector", - "version": "0.1.26", + "version": "0.1.27", "license": "Apache-2.0", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/objectdetector/package.json b/plugins/objectdetector/package.json index 73207774c..81d6ab748 100644 --- a/plugins/objectdetector/package.json +++ b/plugins/objectdetector/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/objectdetector", - "version": "0.1.26", + "version": "0.1.27", "description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/objectdetector/src/main.ts b/plugins/objectdetector/src/main.ts index 937114805..557ec8423 100644 --- a/plugins/objectdetector/src/main.ts +++ b/plugins/objectdetector/src/main.ts @@ -1028,7 +1028,8 @@ export class ObjectDetectionPlugin extends AutoenableMixinProvider implements Se if (runningDetections.find(o => o.id === mixin.id)) return false; - if (!runningDetections.length) + // always allow 2 cameras to push past cpu throttling + if (runningDetections.length < 2) return true; const cpuPerDetector = this.cpuUsage / runningDetections.length;