TONNXRuntime
1.0.0
이것은 Freepascal을위한 Microsoft의 Open Neural Neurnet Exchange (OnnxRuntime)의 구현입니까? 그리고 델파이 ⚔️
OnnxRuntime 라이브러리는 Windows 8 이후 대부분의 최신 Windows 릴리스와 함께 제공됩니다.이 시간이 지남에 따라 버전 1.13.1은 가장 최근의 릴리스이며 MacOS 및 대부분의 Linux 릴리스에 설치할 수 있습니다. 개발 및 업데이트는 OnnxRuntime Github 페이지를 방문하십시오.
onnxruntime.dll 이미 Windows %WINDIR%System32onnxruntime.dll 함께 배송되었습니다 %WINDIR%SysWOW64onnxruntime.dll
https://github.com/microsoft/onnxruntime/releases를 확인하십시오
Pascal 유닛의 헤더의 나사로 또는 델파이 프로젝트에서 파일을 포함합니다.
unit formUnit;
{ $h+ }
interface
uses onnxruntime_pas_api, onnxruntime, Classes etc... ; var
session : TORTSession;
begin
session := TORTSession.Create( ' ./mymodel/filname.onnx ' );
{
*****************************************************************
Check your model requirements for input/output
names and value dimensions before preparing the inputs.
to explore the model before preparing use :
session.GetInputCount and session.GetOutputCount
session.GetInputName and session.GetOutputName
session.GetInputTypeInfo and session.GetOutputTypeInfo
****************************************************************
} TORTTensor<type> 사용하여 원하는 모양의 입력 텐서와 TORTNameValueList 사용하여 입력을 준비하십시오. var
x,y:integer;
imageData : array of array of single;
inTensor : TORTTensor<single> ;
inputs : TORTNameValueList ;
begin
// assuming the model input name is 'image' and the tensor shape is [width, height]
inTensor := TORTTensor<single>.Create([width, height { , depth ,etc... } ]);
for y:= 0 to inTensor.shape[ 1 ]- 1 do
for x:= 0 to inTensor.shape[ 0 ]- 1 do
inTensor.index2[x, y]:= imageData[x, y]; // your float values
inputs[ ' image ' ] := inTensor; var
myDetection : array of single;
i:integer;
outputs : TORTNameValueList;
outTensor : TORTTensor<single>
begin
outputs := session.run(inputs);
outTensor := outputs[ ' result ' ]
for i:= 0 to outTensor.shape[ 0 ] do
myDetection[i] := outTensor.index1[i]CPU : 더 빠른 RCNN10 예제 폴더
여기에서 FasterRCNN-10.onnx 다운로드하십시오
GPU : Yolo V7 (DirectMl) 폴더
여기에서 yolov7_640x640.onnx 다운로드하여 추출하십시오