videoanalysis: log filtered detections

This commit is contained in:
Koushik Dutta
2024-11-15 10:06:38 -08:00
parent 68183775db
commit 0871898385
3 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

@@ -162,7 +162,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
getCurrentSettings() {
const settings = this.model.settings;
if (!settings)
return { id : this.id };
return { id: this.id };
const ret: { [key: string]: any } = {};
for (const setting of settings) {
@@ -338,7 +338,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
if (this.model.decoder) {
if (!options?.suppress)
this.console.log(this.objectDetection.name, '(with builtin decoder)');
this.console.log(this.objectDetection.name, '(with builtin decoder)');
return stream;
}
@@ -456,10 +456,10 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
if (!this.hasMotionType) {
this.plugin.trackDetection();
// const numZonedDetections = zonedDetections.filter(d => d.className !== 'motion').length;
// const numOriginalDetections = originalDetections.filter(d => d.className !== 'motion').length;
// if (numZonedDetections !== numOriginalDetections)
// this.console.log('Zone filtered detections:', numZonedDetections - numOriginalDetections);
const numZonedDetections = zonedDetections.filter(d => d.className !== 'motion').length;
const numOriginalDetections = originalDetections.filter(d => d.className !== 'motion').length;
if (numZonedDetections !== numOriginalDetections)
currentDetections.set('filtered', (currentDetections.get('filtered') || 0) + 1);
for (const d of detected.detected.detections) {
currentDetections.set(d.className, Math.max(currentDetections.get(d.className) || 0, d.score));