هذا هو تطبيق لتبادل الشبكات العصبية المفتوحة من Microsoft (OnNxRuntime) ل Freepascal؟ و Delphi ⚔
تأتي مكتبات OnNxRuntime مع معظم إصدارات Windows الحديثة بعد Windows 8 ، اعتبارًا من الوقت المكتوب ، الإصدار 1.13.1 هو أحدث إصدار ، ويمكن تثبيته على MacOS ومعظم إصدارات Linux ، من أجل التطوير والتحديثات ، يرجى زيارة صفحة GitHub OnNxRuntime.
تم شحن onnxruntime.dll بالفعل مع النوافذ ، يمكنك العثور عليه في %WINDIR%SysWOW64onnxruntime.dll أو %WINDIR%System32onnxruntime.dll
تحقق من https://github.com/microsoft/onnxruntime/releases
من مشروع Lazarus أو Delphi الخاص بك على رأس وحدة 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]وحدة المعالجة المركزية: مجلد مثال RCNN10 أسرع
تنزيل FasterRCNN-10.onnx من هنا
GPU: مجلد Yolo V7 (DIRECTML)
قم بتنزيل واستخراج yolov7_640x640.onnx من هنا