### Description See https://github.com/microsoft/onnxruntime-extensions/pull/476 and https://github.com/actions/runner-images/issues/7671 ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> ### Current issue - [ ] For default xcode 15.2, that come with the MacOS-13, We Need to update the boost container header boost/container_hash/hash.hpp version to pass the build - [x] For xcode 14.2 The Build passed but the `Run React Native Detox Android e2e Test` Failed. Possible flaky test, https://github.com/microsoft/onnxruntime/pull/21969 - [x] For xcode 14.3.1 We encountered following issue in `Build React Native Detox iOS e2e Tests` ``` ld: file not found: /Applications/Xcode_14.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` Applied following code to the eof in both ios/Podfile and fixed the issue ``` post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' end end end end ``` - [x] https://github.com/facebook/react-native/issues/32483 Applying changes to ios/Pofile ``` pre_install do |installer| # Custom pre-install script or commands puts "Running pre-install script..." # Recommended fix for https://github.com/facebook/react-native/issues/32483 # from https://github.com/facebook/react-native/issues/32483#issuecomment-966784501 system("sed -i '' 's/typedef uint8_t clockid_t;//' \"${SRCROOT}/Pods/RCT-Folly/folly/portability/Time.h\"") end ``` - [ ] Detox environment setting up exceeded time out of 120000ms during iso e2e test ### dependent - [x] https://github.com/microsoft/onnxruntime/pull/21159 --------- Co-authored-by: Changming Sun <chasun@microsoft.com> |
||
|---|---|---|
| .. | ||
| android | ||
| e2e | ||
| ios | ||
| lib | ||
| scripts | ||
| .gitignore | ||
| app.plugin.js | ||
| babel.config.js | ||
| onnxruntime-react-native.podspec | ||
| package.json | ||
| README.md | ||
| test_types_models.readme.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsconfig.scripts.json | ||
| unimodule.json | ||
| yarn.lock | ||
onnxruntime-react-native
ONNX Runtime React Native provides a JavaScript library for running ONNX models in a React Native app.
Why ONNX models
The Open Neural Network Exchange (ONNX) is an open standard for representing machine learning models. The biggest advantage of ONNX is that it allows interoperability across different open source AI frameworks, which itself offers more flexibility for AI frameworks adoption.
Why ONNX Runtime React Native
With ONNX Runtime React Native, React Native developers can score pre-trained ONNX models directly in React Native apps by leveraging ONNX Runtime, so it provides a light-weight inference solution for Android and iOS.
Installation
yarn add onnxruntime-react-native
Usage
import { InferenceSession } from "onnxruntime-react-native";
// load a model
const session: InferenceSession = await InferenceSession.create(modelPath);
// input as InferenceSession.OnnxValueMapType
const result = session.run(input, ['num_detection:0', 'detection_classes:0'])
Refer to ONNX Runtime JavaScript examples for samples and tutorials. The ONNX Runtime React Native library does not currently support the following features:
- Tensors with unsigned data types, with the exception of uint8 on Android devices
- Model loading using ArrayBuffer
Operator and type support
ONNX Runtime React Native version 1.13 supports both ONNX and ORT format models, and includes all operators and types.
Previous ONNX Runtime React Native packages use the ONNX Runtime Mobile package, and support operators and types used in popular mobile models. See here for the list of supported operators and types.
License
License information can be found here.