videoanalysis: fix cpu calc

This commit is contained in:
Koushik Dutta
2023-06-27 23:23:02 -07:00
parent 44dc648398
commit 2ffe67b2db
3 changed files with 5 additions and 9 deletions

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import os from 'os';
let maxObservedSpeed = 0;
let totalGigahertz = 0;
export function getMaxConcurrentObjectDetectionSessions() {
const cpus = os.cpus();
@@ -20,11 +20,7 @@ export function getMaxConcurrentObjectDetectionSessions() {
speed += cpu.speed || 600;
}
maxObservedSpeed = Math.max(speed, maxObservedSpeed);
// this is not exactly accurate because intel chips have e-cores
// so the cpus are not uniform performance.
const totalGigahertz = maxObservedSpeed * cpus.length;
totalGigahertz = Math.max(speed, totalGigahertz);
// a wyse 5070 self reports in description as 1.5ghz and has 4 cores and can comfortably handle
// two 2k detections at the same time.