v1.4.1
onnxruntime
OnnxRuntime용 Flutter 플러그인은 모바일 및 데스크톱 플랫폼에서 Flutter 앱에 Onnx 모델을 쉽게, 유연하고 빠르게 통합할 수 있는 간편하고 유연하며 빠른 Dart API를 제공합니다.
73좋아요 1.5만30일 다운로드150Pub 점수
AndroidiOSmacOSWindowsLinux
OnnxRuntime용 플러터 플러그인은 모바일 및 데스크톱 플랫폼에서 플러터 앱에 Onnx 모델을 통합하기 위한 간편하고 유연하며 빠른 Dart API를 제공합니다.
{"sdk":"flutter"}^2.0.1^7.2.11{"sdk":"flutter"}^2.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
https://github.com/microsoft/onnxruntime/raw/main/docs/images/ONNX_Runtime_logo_dark.png
Flutter plugin for OnnxRuntime via dart:ffi provides an easy, flexible, and fast Dart API to integrate Onnx models in flutter apps across mobile and desktop platforms.
| Platform | Android | iOS | Linux | macOS | Windows |
|---|---|---|---|---|---|
| Compatibility | API level 21+ | * | * | * | * |
| Architecture | arm32/arm64 | * | * | * | * |
In your flutter project add the dependency:
dependencies:
...
onnxruntime: x.y.z
import 'package:onnxruntime/onnxruntime.dart';
OrtEnv.instance.init();
final sessionOptions = OrtSessionOptions();
const assetFileName = 'assets/models/test.onnx';
final rawAssetFile = await rootBundle.load(assetFileName);
final bytes = rawAssetFile.buffer.asUint8List();
final session = OrtSession.fromBuffer(bytes, sessionOptions!);
final shape = [1, 2, 3];
final inputOrt = OrtValueTensor.createTensorWithDataList(data, shape);
final inputs = {'input': inputOrt};
final runOptions = OrtRunOptions();
final outputs = await _session?.runAsync(runOptions, inputs);
inputOrt.release();
runOptions.release();
outputs?.forEach((element) {
element?.release();
});
OrtEnv.instance.release();