From 9a770e9dc99ba020f9b64ecdd5c39105f3778d45 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 3 Jun 2024 15:08:58 -0700 Subject: [PATCH] predict: update models --- plugins/coreml/package-lock.json | 4 ++-- plugins/coreml/package.json | 2 +- plugins/onnx/src/ort/__init__.py | 4 ++-- plugins/onnx/src/ort/face_recognition.py | 2 +- plugins/onnx/src/ort/text_recognition.py | 2 +- plugins/openvino/package-lock.json | 4 ++-- plugins/openvino/package.json | 2 +- plugins/openvino/src/ov/__init__.py | 15 ++++++++------- plugins/openvino/src/ov/face_recognition.py | 4 ++-- plugins/openvino/src/ov/text_recognition.py | 4 ++-- .../tensorflow-lite/src/predict/face_recognize.py | 4 ++-- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/plugins/coreml/package-lock.json b/plugins/coreml/package-lock.json index f6ea808c99..78bcff66a7 100644 --- a/plugins/coreml/package-lock.json +++ b/plugins/coreml/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/coreml", - "version": "0.1.55", + "version": "0.1.56", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/coreml", - "version": "0.1.55", + "version": "0.1.56", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/coreml/package.json b/plugins/coreml/package.json index 9991da9c2e..86e638bef4 100644 --- a/plugins/coreml/package.json +++ b/plugins/coreml/package.json @@ -42,5 +42,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.55" + "version": "0.1.56" } diff --git a/plugins/onnx/src/ort/__init__.py b/plugins/onnx/src/ort/__init__.py index 881cbe34ed..b609605c00 100644 --- a/plugins/onnx/src/ort/__init__.py +++ b/plugins/onnx/src/ort/__init__.py @@ -55,7 +55,7 @@ def __init__(self, nativeId: str | None = None): if model == "Default" or model not in availableModels: if model != "Default": self.storage.setItem("model", "Default") - model = "scrypted_yolov8n_320" + model = "scrypted_yolov10m_320" self.yolo = "yolo" in model self.scrypted_yolov10 = "scrypted_yolov10" in model self.scrypted_yolo_nas = "scrypted_yolo_nas" in model @@ -68,7 +68,7 @@ def __init__(self, nativeId: str | None = None): model_version = "v2" onnxfile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/onnx-models/main/{model}/{onnxmodel}.onnx", + f"https://github.com/koush/onnx-models/raw/main/{model}/{onnxmodel}.onnx", f"{model_version}/{model}/{onnxmodel}.onnx", ) diff --git a/plugins/onnx/src/ort/face_recognition.py b/plugins/onnx/src/ort/face_recognition.py index 06ddac8820..cee158b035 100644 --- a/plugins/onnx/src/ort/face_recognition.py +++ b/plugins/onnx/src/ort/face_recognition.py @@ -23,7 +23,7 @@ def downloadModel(self, model: str): onnxmodel = "best" if "scrypted" in model else model model_version = "v1" onnxfile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/onnx-models/main/{model}/{onnxmodel}.onnx", + f"https://github.com/koush/onnx-models/raw/main/{model}/{onnxmodel}.onnx", f"{model_version}/{model}/{onnxmodel}.onnx", ) print(onnxfile) diff --git a/plugins/onnx/src/ort/text_recognition.py b/plugins/onnx/src/ort/text_recognition.py index ab25a3e643..cbfe3da728 100644 --- a/plugins/onnx/src/ort/text_recognition.py +++ b/plugins/onnx/src/ort/text_recognition.py @@ -23,7 +23,7 @@ def downloadModel(self, model: str): onnxmodel = model model_version = "v3" onnxfile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/onnx-models/main/{model}/{onnxmodel}.onnx", + f"https://github.com/koush/onnx-models/raw/main/{model}/{onnxmodel}.onnx", f"{model_version}/{model}/{onnxmodel}.onnx", ) print(onnxfile) diff --git a/plugins/openvino/package-lock.json b/plugins/openvino/package-lock.json index e05a5091d4..1c1440ce7e 100644 --- a/plugins/openvino/package-lock.json +++ b/plugins/openvino/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/openvino", - "version": "0.1.92", + "version": "0.1.95", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/openvino", - "version": "0.1.92", + "version": "0.1.95", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/openvino/package.json b/plugins/openvino/package.json index 4e9312bb51..84d0357f00 100644 --- a/plugins/openvino/package.json +++ b/plugins/openvino/package.json @@ -42,5 +42,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.92" + "version": "0.1.95" } diff --git a/plugins/openvino/src/ov/__init__.py b/plugins/openvino/src/ov/__init__.py index b0ce5e0604..64d7b7e00b 100644 --- a/plugins/openvino/src/ov/__init__.py +++ b/plugins/openvino/src/ov/__init__.py @@ -31,6 +31,7 @@ availableModels = [ "Default", "scrypted_yolov10m_320", + "scrypted_yolov10s_320", "scrypted_yolov10n_320", "scrypted_yolo_nas_s_320", "scrypted_yolov6n_320", @@ -134,7 +135,7 @@ def __init__(self, nativeId: str | None = None): if model == "Default" or model not in availableModels: if model != "Default": self.storage.setItem("model", "Default") - model = "scrypted_yolov8n_320" + model = "scrypted_yolov10n_320" self.yolo = "yolo" in model self.scrypted_yolov10 = "scrypted_yolov10" in model self.scrypted_yolo_nas = "scrypted_yolo_nas" in model @@ -148,31 +149,31 @@ def __init__(self, nativeId: str | None = None): model_version = "v5" xmlFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.xml", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.xml", f"{model_version}/{model}/{precision}/{ovmodel}.xml", ) binFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.bin", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.bin", f"{model_version}/{model}/{precision}/{ovmodel}.bin", ) if self.scrypted_yolo_nas: labelsFile = self.downloadFile( - "https://raw.githubusercontent.com/koush/openvino-models/main/scrypted_nas_labels.txt", + "https://github.com/koush/openvino-models/raw/main/scrypted_nas_labels.txt", "scrypted_nas_labels.txt", ) elif self.scrypted_model: labelsFile = self.downloadFile( - "https://raw.githubusercontent.com/koush/openvino-models/main/scrypted_labels.txt", + "https://github.com/koush/openvino-models/raw/main/scrypted_labels.txt", "scrypted_labels.txt", ) elif self.yolo: labelsFile = self.downloadFile( - "https://raw.githubusercontent.com/koush/openvino-models/main/coco_80cl.txt", + "https://github.com/koush/openvino-models/raw/main/coco_80cl.txt", "coco_80cl.txt", ) else: labelsFile = self.downloadFile( - "https://raw.githubusercontent.com/koush/openvino-models/main/coco_labels.txt", + "https://github.com/koush/openvino-models/raw/main/coco_labels.txt", "coco_labels.txt", ) diff --git a/plugins/openvino/src/ov/face_recognition.py b/plugins/openvino/src/ov/face_recognition.py index 2fe937b7d9..017f9c3b3b 100644 --- a/plugins/openvino/src/ov/face_recognition.py +++ b/plugins/openvino/src/ov/face_recognition.py @@ -26,11 +26,11 @@ def downloadModel(self, model: str): precision = self.plugin.precision model_version = "v5" xmlFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.xml", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.xml", f"{model_version}/{model}/{precision}/{ovmodel}.xml", ) binFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.bin", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.bin", f"{model_version}/{model}/{precision}/{ovmodel}.bin", ) print(xmlFile, binFile) diff --git a/plugins/openvino/src/ov/text_recognition.py b/plugins/openvino/src/ov/text_recognition.py index 252132977d..098b165b77 100644 --- a/plugins/openvino/src/ov/text_recognition.py +++ b/plugins/openvino/src/ov/text_recognition.py @@ -25,11 +25,11 @@ def downloadModel(self, model: str): precision = self.plugin.precision model_version = "v5" xmlFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.xml", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.xml", f"{model_version}/{model}/{precision}/{ovmodel}.xml", ) binFile = self.downloadFile( - f"https://raw.githubusercontent.com/koush/openvino-models/main/{model}/{precision}/{ovmodel}.bin", + f"https://github.com/koush/openvino-models/raw/main/{model}/{precision}/{ovmodel}.bin", f"{model_version}/{model}/{precision}/{ovmodel}.bin", ) print(xmlFile, binFile) diff --git a/plugins/tensorflow-lite/src/predict/face_recognize.py b/plugins/tensorflow-lite/src/predict/face_recognize.py index e14e7810bb..a8b3801774 100644 --- a/plugins/tensorflow-lite/src/predict/face_recognize.py +++ b/plugins/tensorflow-lite/src/predict/face_recognize.py @@ -31,7 +31,7 @@ def __init__(self, nativeId: str | None = None): self.loop = asyncio.get_event_loop() self.minThreshold = 0.7 - self.detectModel = self.downloadModel("scrypted_yolov9c_flt") + self.detectModel = self.downloadModel("scrypted_yolov10m_face") self.faceModel = self.downloadModel("inception_resnet_v1") def downloadModel(self, model: str): @@ -49,7 +49,7 @@ def get_input_format(self) -> str: async def detect_once(self, input: Image.Image, settings: Any, src_size, cvss): results = await self.predictDetectModel(input) - objs = yolo.parse_yolov9(results) + objs = yolo.parse_yolov10(results) ret = self.create_detection_result(objs, src_size, cvss) return ret