objectdetector: publish new architecture

This commit is contained in:
Koushik Dutta
2021-12-06 01:39:54 -08:00
parent 4daed36b0d
commit 86f790522d
12 changed files with 54 additions and 21 deletions

View File

@@ -6,4 +6,5 @@ fs
src
.vscode
dist/*.js
dist/*.txt
HAP-NodeJS

View File

@@ -1,5 +1,8 @@
.DS_Store
out/
node_modules/
dist/*.map
face-api.js
*.map
fs
src
.vscode
dist/*.js

View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.13",
"description": "Object Detection extension for VideoCameras. Installed alongside a CPU or TPU plugin.",
"version": "0.0.18",
"description": "Object Detector for VideoCameras. Installed alongside a detection service.",
"author": "Scrypted",
"license": "Apache-2.0",
"scripts": {
@@ -30,7 +30,7 @@
"person"
],
"scrypted": {
"name": "Object Detection Plugin",
"name": "Object Detector Plugin",
"singleInstance": true,
"type": "API",
"interfaces": [

View File

@@ -2,6 +2,7 @@ import { MixinProvider, ScryptedDeviceType, ScryptedInterface, MediaObject, Vide
import sdk from '@scrypted/sdk';
import { SettingsMixinDeviceBase } from "../../../common/src/settings-mixin";
import { randomBytes } from 'crypto';
import { alertRecommendedPlugins } from '@scrypted/common/src/alert-recommended-plugins';
import { DenoisedDetectionEntry, denoiseDetections } from './denoise';
export interface DetectionInput {
@@ -309,6 +310,11 @@ class ObjectDetectionPlugin extends ScryptedDeviceBase implements MixinProvider
if (!device.mixins?.includes(this.id))
continue;
device.probe();
alertRecommendedPlugins({
'@scrypted/tensorflow': 'TensorFlow Face Recognition Plugin',
'@scrypted/tensorflow-lite': 'TensorFlow Lite Object Detection Plugin',
});
}
}

View File

@@ -6,4 +6,6 @@ fs
src
.vscode
dist/*.js
dist/*.txt
__pycache__
all_models

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/coral",
"version": "0.0.15",
"version": "0.0.21",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/coral",
"version": "0.0.15",
"version": "0.0.21",
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
}

View File

@@ -1,6 +1,20 @@
{
"name": "@scrypted/tensowflow-lite",
"description": "Object Detection for VideoCameras.",
"name": "@scrypted/tensorflow-lite",
"description": "Object Detection Service.",
"keywords": [
"scrypted",
"plugin",
"tensorflow",
"coral",
"tpu",
"edge",
"motion",
"object",
"detect",
"detection",
"people",
"person"
],
"scripts": {
"prepublishOnly": "NODE_ENV=production scrypted-webpack",
"prescrypted-vscode-launch": "scrypted-webpack",
@@ -15,7 +29,7 @@
"scrypted": {
"name": "TensorFlow Lite + Coral TPU Object Detection Plugin",
"runtime": "python",
"type": "Light",
"type": "API",
"interfaces": [
"ObjectDetection"
]
@@ -23,5 +37,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.15"
"version": "0.0.21"
}

View File

@@ -1,5 +1,10 @@
.DS_Store
out/
node_modules/
dist/*.map
*.map
fs
src
.vscode
dist/*.js
dist/*.txt
face-api.js

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/tensorflow",
"version": "0.0.13",
"version": "0.0.16",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/tensorflow",
"version": "0.0.13",
"version": "0.0.16",
"license": "Apache-2.0",
"dependencies": {
"@koush/face-api.js": "^0.22.3",

View File

@@ -1,7 +1,7 @@
{
"name": "@scrypted/tensorflow",
"version": "0.0.13",
"description": "Face Recognition for VideoCameras.",
"version": "0.0.16",
"description": "Face Recognition Service.",
"author": "Scrypted",
"license": "Apache-2.0",
"scripts": {
@@ -20,8 +20,6 @@
"plugin",
"tensorflow",
"motion",
"object",
"detect",
"detection",
"face",
"recognition",

View File

@@ -13,6 +13,7 @@ import { sleep } from './sleep';
import { makeBoundingBoxFromFace } from './util';
import { FFMpegRebroadcastSession, startRebroadcastSession } from '../../../common/src/ffmpeg-rebroadcast';
import { createRawVideoParser, PIXEL_FORMAT_RGB24, StreamChunk } from '@scrypted/common/src/stream-parser';
import { alertRecommendedPlugins } from '@scrypted/common/src/alert-recommended-plugins';
import { once } from 'events';
import { decodeJpeg, encodeJpeg } from './jpeg';
import { EventEmitter } from 'stream';
@@ -166,6 +167,10 @@ class TensorFlow extends ScryptedDeviceBase implements ObjectDetection, DevicePr
}
this.reloadFaceMatcher();
alertRecommendedPlugins({
'@scrypted/objectdetector': 'Object Detection Plugin',
});
}
async addUnknowns(unknowns: { descriptor: Float32Array, nativeId: string, detection: FaceDetection }[], input: Tensor3D, buffer: Buffer) {
@@ -363,7 +368,6 @@ class TensorFlow extends ScryptedDeviceBase implements ObjectDetection, DevicePr
if (!detectionSession.running)
return;
this.onDeviceEvent(ScryptedInterface.ObjectDetection, detections);
this.console.log(detections);
await sleep(1000);
}