mirror of
https://github.com/koush/scrypted.git
synced 2026-05-26 06:30:29 +01:00
onnx: publish
This commit is contained in:
4
plugins/onnx/.vscode/settings.json
vendored
4
plugins/onnx/.vscode/settings.json
vendored
@@ -1,9 +1,9 @@
|
||||
|
||||
{
|
||||
// docker installation
|
||||
// "scrypted.debugHost": "koushik-ubuntu",
|
||||
// "scrypted.debugHost": "koushik-ubuntuvm",
|
||||
// "scrypted.serverRoot": "/server",
|
||||
|
||||
|
||||
// pi local installation
|
||||
// "scrypted.debugHost": "192.168.2.119",
|
||||
// "scrypted.serverRoot": "/home/pi/.scrypted",
|
||||
|
||||
4
plugins/onnx/package-lock.json
generated
4
plugins/onnx/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/openvino",
|
||||
"version": "0.1.79",
|
||||
"version": "0.1.80",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/openvino",
|
||||
"version": "0.1.79",
|
||||
"version": "0.1.80",
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
}
|
||||
|
||||
@@ -41,5 +41,5 @@
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
},
|
||||
"version": "0.1.79"
|
||||
"version": "0.1.80"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
from typing import Any, Tuple
|
||||
|
||||
import sys
|
||||
import platform
|
||||
import numpy as np
|
||||
import onnxruntime
|
||||
import scrypted_sdk
|
||||
@@ -65,7 +67,18 @@ class ONNXPlugin(
|
||||
print(onnxfile)
|
||||
|
||||
try:
|
||||
self.compiled_model = onnxruntime.InferenceSession(onnxfile)
|
||||
sess_options = onnxruntime.SessionOptions()
|
||||
|
||||
providers: list[str] = []
|
||||
if sys.platform == 'darwin':
|
||||
providers.append("CoreMLExecutionProvider")
|
||||
|
||||
if sys.platform == 'linux' and platform.machine() == 'x86_64':
|
||||
providers.append("CUDAExecutionProvider")
|
||||
|
||||
providers.append('CPUExecutionProvider')
|
||||
|
||||
self.compiled_model = onnxruntime.InferenceSession(onnxfile, sess_options=sess_options, providers=providers)
|
||||
except:
|
||||
import traceback
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
onnxruntime
|
||||
--extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
|
||||
# cuda 12
|
||||
onnxruntime-gpu; sys_platform == 'linux' and platform_machine == 'x86_64'
|
||||
# cpu and coreml execution provider
|
||||
onnxruntime; sys_platform != 'linux' or platform_machine != 'x86_64'
|
||||
# ort-nightly-gpu==1.17.3.dev20240409002
|
||||
|
||||
# pillow-simd is available on x64 linux
|
||||
# pillow-simd confirmed not building with arm64 linux or apple silicon
|
||||
|
||||
Reference in New Issue
Block a user