Skip to content

Commit

Permalink
openvino/coreml: new models
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Apr 8, 2024
1 parent ae63e60 commit c35142a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
4 changes: 2 additions & 2 deletions plugins/coreml/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/coreml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.1.31"
"version": "0.1.33"
}
16 changes: 12 additions & 4 deletions plugins/coreml/src/coreml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations

import ast
import asyncio
import concurrent.futures
import os
import platform
import re
from typing import Any, Tuple

Expand All @@ -12,7 +14,6 @@
from scrypted_sdk import Setting, SettingValue

import yolo
import ast
from predict import Prediction, PredictPlugin, Rectangle

predictExecutor = concurrent.futures.ThreadPoolExecutor(8, "CoreML-Predict")
Expand Down Expand Up @@ -50,12 +51,16 @@ def __init__(self, nativeId: str | None = None):

model = self.storage.getItem("model") or "Default"
if model == "Default":
model = "yolov8n_320"
# if arch is arm64, use yolov9c, otherwise use yolov8n
if platform.machine() == 'arm64':
model = "scrypted_yolov9c_320"
else:
model = "scrypted_yolov8n_320"
self.yolo = "yolo" in model
self.yolov8 = "yolov8" in model
self.yolov9 = "yolov9" in model
self.scrypted_model = "scrypted" in model
model_version = "v3"
model_version = "v4"
mlmodel = 'model' if self.yolov8 or self.yolov9 else model

print(f"model: {model}")
Expand Down Expand Up @@ -142,12 +147,15 @@ async def getSettings(self) -> list[Setting]:
"description": "The detection model used to find objects.",
"choices": [
"Default",
"scrypted_yolov9c_320",
"scrypted_yolov8n_320",
"scrypted_yolov9c",
"scrypted_yolov8n",
"yolov8n_320",
"yolov9c_320",
"ssdlite_mobilenet_v2",
"yolov8n",
"yolov9c",
"ssdlite_mobilenet_v2",
"yolov4-tiny",
],
"value": model,
Expand Down
4 changes: 2 additions & 2 deletions plugins/openvino/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/openvino/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.1.55"
"version": "0.1.56"
}
10 changes: 7 additions & 3 deletions plugins/openvino/src/ov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, nativeId: str | None = None):

model = self.storage.getItem('model') or 'Default'
if model == 'Default':
model = 'yolov8n_320'
model = 'scrypted_yolov8n_320'
self.yolo = 'yolo' in model
self.yolov8 = "yolov8" in model
self.yolov9 = "yolov9" in model
Expand Down Expand Up @@ -137,14 +137,18 @@ async def getSettings(self) -> list[Setting]:
'description': 'The detection model used to find objects.',
'choices': [
'Default',
'scrypted_yolov9c_320',
'scrypted_yolov8n_320',
'yolov8n_320',
'scrypted_yolov9c',
'scrypted_yolov8n',
'yolov9c_320',
'yolov8n_320',
'yolov9c',
'yolov8n',
'ssd_mobilenet_v1_coco',
'ssdlite_mobilenet_v2',
'yolo-v3-tiny-tf',
'yolo-v4-tiny-tf',
'yolov8n',
],
'value': model,
},
Expand Down

0 comments on commit c35142a

Please sign in to comment.