diff --git a/plugins/core/package-lock.json b/plugins/core/package-lock.json index 5c6e69898..0d762002b 100644 --- a/plugins/core/package-lock.json +++ b/plugins/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/core", - "version": "0.0.139", + "version": "0.0.148", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/core", - "version": "0.0.139", + "version": "0.0.148", "license": "Apache-2.0", "dependencies": { "@koush/wrtc": "^0.5.0", diff --git a/plugins/core/package.json b/plugins/core/package.json index 5f64797e1..ab1b4e62b 100644 --- a/plugins/core/package.json +++ b/plugins/core/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/core", - "version": "0.0.147", + "version": "0.0.148", "description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/core/ui/src/interfaces/Camera.vue b/plugins/core/ui/src/interfaces/Camera.vue index 2c753f99e..59a0e4c89 100644 --- a/plugins/core/ui/src/interfaces/Camera.vue +++ b/plugins/core/ui/src/interfaces/Camera.vue @@ -5,13 +5,20 @@ > - +
+ + +
@@ -24,14 +31,50 @@ export default { mixins: [RPCInterface], data() { return { + lastDetection: null, + objectListener: this.device.listen( + ScryptedInterface.ObjectDetector, + (s, d, e) => (this.lastDetection = e) + ), pc: undefined, src: "images/cameraloading.jpg", dialog: false, disabled: !this.device.interfaces.includes(ScryptedInterface.VideoCamera), }; }, + computed: { + svgWidth() { + return this.lastDetection?.inputDimensions?.[0] || 1920; + }, + svgHeight() { + return this.lastDetection?.inputDimensions?.[1] || 1080; + }, + svgContents() { + if (!this.lastDetection) return ""; + + let contents = ""; + for (const detection of this.lastDetection.detections) { + const sw = 2; + const s = "red"; + const x = detection.boundingBox[0]; + const y = detection.boundingBox[1]; + const w = detection.boundingBox[2] - x; + const h = detection.boundingBox[3] - y; + const t = detection.className; + const fs = 20; + const box = + ` + ${t} + ${t}`; + contents += box; + } + + return contents; + }, + }, destroyed() { this.cleanupConnection(); + this.objectListener.removeListener(); }, methods: { cleanupConnection() { diff --git a/plugins/core/ui/src/interfaces/DeviceProvider.vue b/plugins/core/ui/src/interfaces/DeviceProvider.vue index 1c4e42c5e..a880f0237 100644 --- a/plugins/core/ui/src/interfaces/DeviceProvider.vue +++ b/plugins/core/ui/src/interfaces/DeviceProvider.vue @@ -6,11 +6,7 @@ max-width="600px" persistent > - +