diff --git a/external/werift b/external/werift index 140faa891..91be7cf46 160000 --- a/external/werift +++ b/external/werift @@ -1 +1 @@ -Subproject commit 140faa891d6bb0156ae846023dc5daee3b3302fa +Subproject commit 91be7cf46954a2da679d417f754653f474043cd6 diff --git a/plugins/objectdetector/src/main.ts b/plugins/objectdetector/src/main.ts index a4e176102..8fd11b539 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, DeviceProvider, DeviceState, EventListenerRegister, MediaObject, MediaStreamDestination, MixinDeviceBase, MixinProvider, MotionSensor, ObjectDetection, ObjectDetectionGeneratorResult, ObjectDetectionModel, ObjectDetectionTypes, ObjectDetector, ObjectsDetected, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, ScryptedNativeId, Setting, Settings, SettingValue, VideoCamera, VideoFrame, VideoFrameGenerator } from '@scrypted/sdk'; +import sdk, { Camera, DeviceProvider, DeviceState, EventListenerRegister, MediaObject, MediaStreamDestination, MixinDeviceBase, MixinProvider, MotionSensor, ObjectDetection, ObjectDetectionGeneratorResult, ObjectDetectionModel, ObjectDetectionTypes, ObjectDetectionZone, ObjectDetector, ObjectsDetected, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, ScryptedNativeId, Setting, Settings, SettingValue, VideoCamera, VideoFrame, VideoFrameGenerator } from '@scrypted/sdk'; import { StorageSettings } from '@scrypted/sdk/storage-settings'; import crypto from 'crypto'; import { AutoenableMixinProvider } from "../../../common/src/autoenable-mixin-provider"; @@ -399,12 +399,33 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase; } export interface ObjectDetectionGeneratorSession { + zones?: ObjectDetectionZone[]; settings?: { [key: string]: any }; sourceId?: string; } @@ -1318,6 +1319,12 @@ export interface ObjectDetectionGeneratorResult { videoFrame: VideoFrame & MediaObject; detected: ObjectsDetected; } +export interface ObjectDetectionZone { + exclusion?: boolean; + type?: 'Intersect' | 'Contain'; + classes?: string[]; + path?: ClipPath; +} /** * ObjectDetection can run classifications or analysis on arbitrary media sources. * E.g. TensorFlow, OpenCV, or a Coral TPU.