videoanalysis: more cpu throttling fixes

This commit is contained in:
Koushik Dutta
2024-02-18 08:45:19 -08:00
parent eb57698c8b
commit 79f4c27bed
3 changed files with 5 additions and 4 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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;