onnx: publish

This commit is contained in:
Koushik Dutta
2024-05-02 19:51:37 -07:00
parent d69ec69038
commit 6fd6c7af14
5 changed files with 25 additions and 7 deletions

View File

@@ -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",

View File

@@ -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"
}

View File

@@ -41,5 +41,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.1.79"
"version": "0.1.80"
}

View File

@@ -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

View File

@@ -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