mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
videoanalysis: fix cpu calc
This commit is contained in:
4
plugins/objectdetector/package-lock.json
generated
4
plugins/objectdetector/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user