mirror of
https://github.com/koush/scrypted.git
synced 2026-05-25 14:10:30 +01:00
videoanalysis: prevent snapshot throttling when its only a single camera
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.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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user