From eb57698c8bad48437b50e2b40d97cb5b2b65bf5f Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 18 Feb 2024 08:42:46 -0800 Subject: [PATCH] videoanalysis: update --- plugins/objectdetector/package-lock.json | 2 +- plugins/objectdetector/src/main.ts | 10 +++++----- plugins/objectdetector/tsconfig.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/objectdetector/package-lock.json b/plugins/objectdetector/package-lock.json index d058dd090..c3ecadc4a 100644 --- a/plugins/objectdetector/package-lock.json +++ b/plugins/objectdetector/package-lock.json @@ -36,7 +36,7 @@ }, "../../sdk": { "name": "@scrypted/sdk", - "version": "0.3.4", + "version": "0.3.12", "license": "ISC", "dependencies": { "@babel/preset-typescript": "^7.18.6", diff --git a/plugins/objectdetector/src/main.ts b/plugins/objectdetector/src/main.ts index 75909e9a9..937114805 100644 --- a/plugins/objectdetector/src/main.ts +++ b/plugins/objectdetector/src/main.ts @@ -1,6 +1,6 @@ import { Deferred } from '@scrypted/common/src/deferred'; import { sleep } from '@scrypted/common/src/sleep'; -import sdk, { Camera, DeviceCreator, DeviceCreatorSettings, DeviceProvider, DeviceState, EventListenerRegister, MediaObject, MediaStreamDestination, MixinDeviceBase, MixinProvider, MotionSensor, ObjectDetection, ObjectDetectionModel, ObjectDetectionTypes, ObjectDetectionZone, ObjectDetector, ObjectsDetected, Point, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedNativeId, Setting, SettingValue, Settings, VideoCamera, VideoFrame, VideoFrameGenerator } from '@scrypted/sdk'; +import sdk, { Camera, DeviceCreator, DeviceCreatorSettings, DeviceProvider, DeviceState, EventListenerRegister, MediaObject, MediaStreamDestination, MixinDeviceBase, MixinProvider, MotionSensor, ObjectDetection, ObjectDetectionModel, ObjectDetectionTypes, ObjectDetectionZone, ObjectDetector, ObjectsDetected, Point, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedNativeId, Setting, SettingValue, Settings, VideoCamera, VideoFrame, VideoFrameGenerator, WritableDeviceState } from '@scrypted/sdk'; import { StorageSettings } from '@scrypted/sdk/storage-settings'; import crypto from 'crypto'; import { AutoenableMixinProvider } from "../../../common/src/autoenable-mixin-provider"; @@ -109,7 +109,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase implements MixinProvider { currentMixins = new Set(); - constructor(mixinDevice: ObjectDetection, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: DeviceState, public plugin: ObjectDetectionPlugin, public model: ObjectDetectionModel) { + constructor(mixinDevice: ObjectDetection, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: WritableDeviceState, public plugin: ObjectDetectionPlugin, public model: ObjectDetectionModel) { super({ mixinDevice, mixinDeviceInterfaces, mixinDeviceState, mixinProviderNativeId: plugin.nativeId }); // trigger mixin creation. todo: fix this to not be stupid hack. @@ -905,7 +905,7 @@ class ObjectDetectorMixin extends MixinDeviceBase implements Mi } } - async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: { [key: string]: any }) { + async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: WritableDeviceState) { let objectDetection = systemManager.getDeviceById(this.id); const hasMotionType = this.model.classes.includes('motion'); const group = hasMotionType ? 'Motion Detection' : 'Object Detection'; @@ -1173,7 +1173,7 @@ export class ObjectDetectionPlugin extends AutoenableMixinProvider implements Se return [ScryptedInterface.MixinProvider]; } - async getMixin(mixinDevice: ObjectDetection, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: { [key: string]: any; }): Promise { + async getMixin(mixinDevice: ObjectDetection, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: WritableDeviceState): Promise { const model = await mixinDevice.getDetectionModel(); const ret = new ObjectDetectorMixin(mixinDevice, mixinDeviceInterfaces, mixinDeviceState, this, model); this.currentMixins.add(ret); diff --git a/plugins/objectdetector/tsconfig.json b/plugins/objectdetector/tsconfig.json index 34a847ad8..ba9b4d395 100644 --- a/plugins/objectdetector/tsconfig.json +++ b/plugins/objectdetector/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "commonjs", + "module": "Node16", "target": "ES2021", "resolveJsonModule": true, "moduleResolution": "Node16",