mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 06:03:27 +00:00
coreml: disable auto restart to work around coreml caching bug filling macos disk until reboot
This commit is contained in:
4
plugins/coreml/package-lock.json
generated
4
plugins/coreml/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/coreml",
|
||||
"version": "0.1.83",
|
||||
"version": "0.1.84",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/coreml",
|
||||
"version": "0.1.83",
|
||||
"version": "0.1.84",
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
},
|
||||
"version": "0.1.83"
|
||||
"version": "0.1.84"
|
||||
}
|
||||
|
||||
@@ -79,6 +79,10 @@ class CoreMLPlugin(
|
||||
def __init__(self, nativeId: str | None = None, forked: bool = False):
|
||||
super().__init__(nativeId=nativeId, forked=forked)
|
||||
|
||||
# this used to work but a bug in macos is causing recompilation of the coreml models every time it restarts
|
||||
# and the cache is not reused and also not cleared until the whole system reboots.
|
||||
self.periodic_restart = False
|
||||
|
||||
self.custom_models = {}
|
||||
|
||||
model = self.storage.getItem("model") or "Default"
|
||||
|
||||
@@ -59,6 +59,8 @@ class PredictPlugin(DetectPlugin, scrypted_sdk.ClusterForkInterface, scrypted_sd
|
||||
):
|
||||
super().__init__(nativeId=nativeId)
|
||||
|
||||
self.periodic_restart = True
|
||||
|
||||
self.systemDevice = {
|
||||
"deviceCreator": "Model",
|
||||
}
|
||||
@@ -119,7 +121,8 @@ class PredictPlugin(DetectPlugin, scrypted_sdk.ClusterForkInterface, scrypted_sd
|
||||
return ["motion"]
|
||||
|
||||
def requestRestart(self):
|
||||
asyncio.ensure_future(scrypted_sdk.deviceManager.requestRestart())
|
||||
if self.periodic_restart:
|
||||
asyncio.ensure_future(scrypted_sdk.deviceManager.requestRestart())
|
||||
|
||||
# width, height, channels
|
||||
def get_input_details(self) -> Tuple[int, int, int]:
|
||||
@@ -392,6 +395,10 @@ class PredictPlugin(DetectPlugin, scrypted_sdk.ClusterForkInterface, scrypted_sd
|
||||
self.forks[cwid] = pf
|
||||
continue
|
||||
|
||||
if self.pluginId not in workers[cwid]['labels']:
|
||||
print(f"not using cluster worker {workers[cwid]['name']} without label {self.pluginId}")
|
||||
continue
|
||||
|
||||
async def startClusterWorker(clusterWorkerId=cwid):
|
||||
print("starting cluster worker", clusterWorkerId)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user