From 04de63ae8e57119394afb419604baa57eb697d0b Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 2 Mar 2024 10:06:26 -0800 Subject: [PATCH] python-codecs: weight the image reader to prefer snapshot plugin. tf/ov publish log spam betas. --- plugins/openvino/package-lock.json | 4 ++-- plugins/openvino/package.json | 2 +- plugins/python-codecs/.vscode/launch.json | 4 ++-- plugins/python-codecs/.vscode/settings.json | 10 +++++++--- plugins/python-codecs/package-lock.json | 4 ++-- plugins/python-codecs/package.json | 2 +- plugins/python-codecs/src/pilimage.py | 2 +- plugins/python-codecs/src/vipsimage.py | 2 +- plugins/tensorflow-lite/package-lock.json | 4 ++-- plugins/tensorflow-lite/package.json | 2 +- plugins/tensorflow-lite/src/detect/__init__.py | 1 + 11 files changed, 21 insertions(+), 16 deletions(-) diff --git a/plugins/openvino/package-lock.json b/plugins/openvino/package-lock.json index e05a6c5fb..0282a5eef 100644 --- a/plugins/openvino/package-lock.json +++ b/plugins/openvino/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/openvino", - "version": "0.1.51", + "version": "0.1.52", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/openvino", - "version": "0.1.51", + "version": "0.1.52", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/openvino/package.json b/plugins/openvino/package.json index 13cab785d..3d3b85b43 100644 --- a/plugins/openvino/package.json +++ b/plugins/openvino/package.json @@ -41,5 +41,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.51" + "version": "0.1.52" } diff --git a/plugins/python-codecs/.vscode/launch.json b/plugins/python-codecs/.vscode/launch.json index e6fa82af0..c2c6e1f4a 100644 --- a/plugins/python-codecs/.vscode/launch.json +++ b/plugins/python-codecs/.vscode/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "name": "Scrypted Debugger", - "type": "python", + "type": "debugpy", "request": "attach", "connect": { "host": "${config:scrypted.debugHost}", @@ -28,7 +28,7 @@ }, { "name": "Python: Test", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/test.py", "console": "internalConsole", diff --git a/plugins/python-codecs/.vscode/settings.json b/plugins/python-codecs/.vscode/settings.json index 086185fc6..12a19c4a1 100644 --- a/plugins/python-codecs/.vscode/settings.json +++ b/plugins/python-codecs/.vscode/settings.json @@ -1,9 +1,13 @@ { // docker installation - // "scrypted.debugHost": "koushik-ubuntu", + // "scrypted.debugHost": "scrypted-server", // "scrypted.serverRoot": "/server", + // lxc installation + "scrypted.debugHost": "scrypted-server", + "scrypted.serverRoot": "/root/.scrypted", + // windows installation // "scrypted.debugHost": "koushik-windows", // "scrypted.serverRoot": "C:\\Users\\koush\\.scrypted", @@ -13,8 +17,8 @@ // "scrypted.serverRoot": "/home/pi/.scrypted", // local checkout - "scrypted.debugHost": "127.0.0.1", - "scrypted.serverRoot": "/Users/koush/.scrypted", + // "scrypted.debugHost": "127.0.0.1", + // "scrypted.serverRoot": "/Users/koush/.scrypted", "scrypted.pythonRemoteRoot": "${config:scrypted.serverRoot}/volume/plugin.zip", "python.analysis.extraPaths": [ diff --git a/plugins/python-codecs/package-lock.json b/plugins/python-codecs/package-lock.json index dc1f21071..350c8aff6 100644 --- a/plugins/python-codecs/package-lock.json +++ b/plugins/python-codecs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/python-codecs", - "version": "0.1.92", + "version": "0.1.93", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/python-codecs", - "version": "0.1.92", + "version": "0.1.93", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/python-codecs/package.json b/plugins/python-codecs/package.json index 0b1fd2ee8..3fdc5a78b 100644 --- a/plugins/python-codecs/package.json +++ b/plugins/python-codecs/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/python-codecs", - "version": "0.1.92", + "version": "0.1.93", "description": "Python Codecs for Scrypted", "keywords": [ "scrypted", diff --git a/plugins/python-codecs/src/pilimage.py b/plugins/python-codecs/src/pilimage.py index 3a3e7fa52..faa644a54 100644 --- a/plugins/python-codecs/src/pilimage.py +++ b/plugins/python-codecs/src/pilimage.py @@ -106,7 +106,7 @@ class ImageReader(scrypted_sdk.ScryptedDeviceBase, scrypted_sdk.BufferConverter) def __init__(self, nativeId: str): super().__init__(nativeId) - self.fromMimeType = 'image/*' + self.fromMimeType = 'image/*;converter-weight=2' self.toMimeType = scrypted_sdk.ScryptedMimeTypes.Image.value async def convert(self, data: Any, fromMimeType: str, toMimeType: str, options: scrypted_sdk.MediaObjectOptions = None) -> Any: diff --git a/plugins/python-codecs/src/vipsimage.py b/plugins/python-codecs/src/vipsimage.py index 2ce53476a..3d61cb62d 100644 --- a/plugins/python-codecs/src/vipsimage.py +++ b/plugins/python-codecs/src/vipsimage.py @@ -104,7 +104,7 @@ class ImageReader(scrypted_sdk.ScryptedDeviceBase, scrypted_sdk.BufferConverter) def __init__(self, nativeId: str): super().__init__(nativeId) - self.fromMimeType = 'image/*' + self.fromMimeType = 'image/*;converter-weight=2' self.toMimeType = scrypted_sdk.ScryptedMimeTypes.Image.value async def convert(self, data: Any, fromMimeType: str, toMimeType: str, options: scrypted_sdk.MediaObjectOptions = None) -> Any: diff --git a/plugins/tensorflow-lite/package-lock.json b/plugins/tensorflow-lite/package-lock.json index 588ebc9ef..3a1d8f336 100644 --- a/plugins/tensorflow-lite/package-lock.json +++ b/plugins/tensorflow-lite/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/tensorflow-lite", - "version": "0.1.46", + "version": "0.1.47", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/tensorflow-lite", - "version": "0.1.46", + "version": "0.1.47", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/tensorflow-lite/package.json b/plugins/tensorflow-lite/package.json index 0c6e9e3d5..8b4c0014d 100644 --- a/plugins/tensorflow-lite/package.json +++ b/plugins/tensorflow-lite/package.json @@ -53,5 +53,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.46" + "version": "0.1.47" } diff --git a/plugins/tensorflow-lite/src/detect/__init__.py b/plugins/tensorflow-lite/src/detect/__init__.py index 2cefd0763..400dcbbc3 100644 --- a/plugins/tensorflow-lite/src/detect/__init__.py +++ b/plugins/tensorflow-lite/src/detect/__init__.py @@ -73,6 +73,7 @@ class DetectPlugin(scrypted_sdk.ScryptedDeviceBase, ObjectDetection): if mediaObject.mimeType == ScryptedMimeTypes.Image.value: image = await scrypted_sdk.sdk.connectRPCObject(mediaObject) else: + print('non image provided') image = await scrypted_sdk.mediaManager.convertMediaObjectToBuffer(mediaObject, ScryptedMimeTypes.Image.value) return await self.run_detection_image(image, session)