plugins: add readmes around detection plugins

This commit is contained in:
Koushik Dutta
2022-11-18 08:58:40 -08:00
parent 5b07b1f445
commit 736c3fe9f5
14 changed files with 43 additions and 32 deletions

View File

@@ -1,3 +1,9 @@
# Video Analysis Plugin for Scrypted
This plugin is used by motion and object detection plugins such as OpenCV, PAM Diff, and Tensorflow.
This plugin is used by motion and detection plugins such as OpenCV, PAM Diff, and Object Detection.
Motion Detection should only be used if your camera does not have a plugin and does not provide motion
events via email or webhooks.
The Object Detection Plugin should only be used if you are a Scrypted NVR user. It will provide no
benefits to HomeKit, which does its own detection processing.

View File

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

View File

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

View File

@@ -1,7 +1,6 @@
import { MixinProvider, ScryptedDeviceType, ScryptedInterface, MediaObject, VideoCamera, Settings, Setting, Camera, EventListenerRegister, ObjectDetector, ObjectDetection, ScryptedDevice, ObjectDetectionResult, ObjectDetectionTypes, ObjectsDetected, MotionSensor, MediaStreamOptions, MixinDeviceBase, ScryptedNativeId, DeviceState, ObjectDetectionCallbacks, ObjectDetectionModel } from '@scrypted/sdk';
import sdk from '@scrypted/sdk';
import { SettingsMixinDeviceBase } from "../../../common/src/settings-mixin";
import { alertRecommendedPlugins } from '@scrypted/common/src/alert-recommended-plugins';
import { DenoisedDetectionEntry, DenoisedDetectionState, denoiseDetections } from './denoise';
import { AutoenableMixinProvider } from "../../../common/src/autoenable-mixin-provider"
import { safeParseJson } from './util';
@@ -746,12 +745,6 @@ class ObjectDetectorMixin extends MixinDeviceBase<ObjectDetection> implements Mi
class ObjectDetectionPlugin extends AutoenableMixinProvider {
constructor(nativeId?: ScryptedNativeId) {
super(nativeId);
alertRecommendedPlugins({
'@scrypted/opencv': "OpenCV Motion Detection Plugin",
// '@scrypted/tensorflow': 'TensorFlow Face Recognition Plugin',
// '@scrypted/tensorflow-lite': 'TensorFlow Lite Object Detection Plugin',
});
}
async canMixin(type: ScryptedDeviceType, interfaces: string[]): Promise<string[]> {

View File

@@ -1,10 +1,13 @@
# Motion Detection Plugin for Scrypted
The OpenCV Motion Detection Plugin adds motion detection to any camera. This can also be used with cameras with built in motion detection.
The OpenCV Motion Detection Plugin adds motion detection to any camera.
Motion Detection should only be used if your camera does not have a plugin and does not provide motion
events via email or webhooks.
## Setup
1. Enable the integration on a camera.
2. Choose the lowest resolution substream available. The plugin does not need to analyze a full resolution video for motion, and processing anything over 300x300 will use excessive CPU time.
3. Configure the motion area and threshold to change the sensitivity.
4. You test your setup in the camera's OpenCV Motion Detection settings, by enabling `Motion Detection Events` to see when motion is triggered.
2. Configure the motion area and threshold to change the sensitivity.
3. You test your setup in the camera's OpenCV Motion Detection settings, by enabling `Motion Detection Events` to see when motion is triggered.

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/opencv",
"version": "0.0.47",
"version": "0.0.49",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/opencv",
"version": "0.0.47",
"version": "0.0.49",
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
}

View File

@@ -35,5 +35,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.47"
"version": "0.0.49"
}

View File

@@ -2,8 +2,11 @@
The PAM Diff Motion Detection Plugin adds motion detection to any camera. This can also be used with cameras with built in motion detection.
Motion Detection should only be used if your camera does not have a plugin and does not provide motion
events via email or webhooks.
## Setup
1. Enable the integration on a camera.
2. Choose the lowest resolution substream available. The plugin does not need to analyze a full resolution video for motion, and processing anything over 300x300 will use excessive CPU time.
3. Configure the motion percent and difference to change the sensitivity.
2. Configure the motion percent and difference to change the sensitivity.

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/pam-diff",
"version": "0.0.14",
"version": "0.0.15",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/pam-diff",
"version": "0.0.14",
"version": "0.0.15",
"hasInstallScript": true,
"dependencies": {
"@types/node": "^16.6.1",

View File

@@ -43,5 +43,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.14"
"version": "0.0.15"
}

View File

@@ -1,3 +1,6 @@
# Object Detection Plugin for Scrypted
This plugin adds object detection capabilities to any camera in Scrypted. Having a fast GPU and CPU is highly recommended. Edge TPU (Coral.ai) is also supported.
The Object Detection Plugin should only be used if you are a Scrypted NVR user. It will provide no
benefits to HomeKit, which does its own detection processing.

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/tensorflow-lite",
"version": "0.0.59",
"version": "0.0.61",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/tensorflow-lite",
"version": "0.0.59",
"version": "0.0.61",
"hasInstallScript": true,
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"

View File

@@ -29,7 +29,7 @@
"scrypted-package-json": "scrypted-package-json"
},
"scrypted": {
"name": "TensorFlow Lite (and Coral) Object Detection",
"name": "Object Detection Plugin",
"pluginDependencies": [
"@scrypted/objectdetector"
],
@@ -44,5 +44,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.59"
"version": "0.0.61"
}

View File

@@ -375,7 +375,10 @@ class TensorFlowLitePlugin(DetectPlugin, scrypted_sdk.BufferConverter, scrypted_
ws = w / iw
hs = h / ih
s = max(ws, hs)
scaled = image.resize((round(s * iw), round(s * ih)), Image.ANTIALIAS)
if ws == 1 and hs == 1:
scaled = image
else:
scaled = image.resize((round(s * iw), round(s * ih)), Image.ANTIALIAS)
first = scaled.crop((0, 0, w, h))
(sx, sy) = scaled.size
@@ -447,10 +450,10 @@ class TensorFlowLitePlugin(DetectPlugin, scrypted_sdk.BufferConverter, scrypted_
ret['detections'].append(detection)
continue
(x, y, w, h) = detection['boundingBox']
cx = x + w / 2
cy = y + h / 2
d = round(max(w, h) * 1.5)
(x, y, dw, dh) = detection['boundingBox']
cx = x + dw / 2
cy = y + dh / 2
d = round(max(dw, dh) * 1.5)
x = round(cx - d / 2)
y = round(cy - d / 2)
x = max(0, x)