Recent

Author Topic: [AI] [ObjectDetection] Run/Train any YOLO model in pure pascal, no dependancies  (Read 5724 times)

Jonvy

  • Full Member
  • ***
  • Posts: 102
This is a very good suggestion,especially the directory structure, it's more friendly to new guys for AI learning, such as me.
But anyway,hshatti did a very good work!

Hi again,


Would be fine that in Compiler->Options->Path

bin\Release\$(TargetCPU)-$(TargetOS)\MapViewer\TestYolo
bin\Debug\$(TargetCPU)-$(TargetOS)\MapViewer\TestYolo

For Different OS

And perhaps a directory structure where we can choose the root Directory

Root-->
-------->Data
-------->Weight
-------->Cfg
-------->Test or (Test_Pictures)

Original Darknet from Joseph Redmon is a mess with the files , I know :)

But that's detail.

Best improvement will be OpenCL or CUDA.


B->

TRon

  • Hero Member
  • *****
  • Posts: 3643
Original Darknet from Joseph Redmon is a mess with the files , I know :)

But that's detail.
Might be but it is enough to turn people off.

Not everyone has the time to delve into someone's code in order to determine what needs to be fixed in order to get things to work in a 'normal' fashion (If I would have to spend that much time then I could very well be the one implementing the project in the first place).

Following the instructions only results in AV's for me on linux 64 bit, Missing files (File not fount :yolov3.weights (parser.pas, line 2809)) and what not.

So, I myself would rather prefer to name it sloppy  :)

But, that's just a very cheap 2 cents remark.

@hshatti:
Not every 64 bit cpu/fpu supports avx(2) instructions, that really needs to be fixed. On Linux the project doesn't compile out of the box because of the getproc declaration (the calling convention is wrong).

Note that you can create different build modes each with their own individual settings (https://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Additions_and_Overrides) and that the (custom) compiler options can be used conditional (https://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Custom_Options) but I get it in case that is not done because of supporting both Delphi and Lazarus and their config differences.

Nice project !
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Jonvy

  • Full Member
  • ***
  • Posts: 102
@hshatti:

I test your example, it works well. But I have a question, your code use .weights file as model weights, but Yolo's result of training is .pt file.

I don't know whether your code can use .pt or .onnx file format?They're more common in Yolo,

Or what's better way to transfer .pt file to .weights file?

Jonvy

Dzandaa

  • Sr. Member
  • ****
  • Posts: 391
  • From C# to Lazarus
Hi,

.pt is PyTorch format.

.weight is darknet original format.

Perhaps google for a converter.

B->
Regards,
Dzandaa

Jonvy

  • Full Member
  • ***
  • Posts: 102
Ok, I find a python script successfully transfer .pt to .weights format.

But I still suggest the project can load .onnx model, since ONNX is an open standard format  to represent machine learning. And it has netron.app to open the model for checking. For .weights file, I don't know which app can open it to check, I'm new for AI, maybe it has app to do it.

Here I met another problem when loading my own .weights model(YoloV5), in file 'nnetwork.pas' at line, the result is 7594607388069359459, beyond longint, so I change line 57 and 164 to int64. But during running, 'parse.pas' line 2829 will get another range check error.

I attach all error here, can anyone tell me how to solve this issue?

BR,
Jonvy

 

TinyPortal © 2005-2018