AlturosDestinations / Alturos.Yolo

C# Yolo Darknet Wrapper (real-time object detection)
MIT License
427 stars 132 forks source link

Net Core Conversion #16

Open nemesis567 opened 5 years ago

nemesis567 commented 5 years ago

I've tried to port this to net core, but I have been unable to run it with this error:

Exception thrown: 'System.DllNotFoundException' in YoloCore.dll Exception thrown: 'System.DllNotFoundException' in System.Private.CoreLib.dll Exception thrown: 'System.DllNotFoundException' in System.Private.CoreLib.dll Exception thrown: 'System.DllNotFoundException' in System.Private.CoreLib.dll An unhandled exception of type 'System.DllNotFoundException' occurred in System.Private.CoreLib.dll Unable to load DLL 'x64\yolo_cpp_dll_cpu.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

If you help me deal with this I can update a new branch here with net core.

tinohager commented 5 years ago

on which os you are test?

nemesis567 commented 5 years ago

Windows 10 pro

tinohager commented 5 years ago

And with the other framework .net46 its work on your windows 10 machine?

nemesis567 commented 5 years ago

No, it gives the same error with both of them.

tinohager commented 5 years ago

Can you check the c++ dll with http://www.dependencywalker.com/

nemesis567 commented 5 years ago

Yes, I did it throws a bunch of errors and I can't see anything properly. I can use OpenCVSharp Yolo V2 with dnn.readNetFromDarknet

tinohager commented 5 years ago

Can you send a screenshot?

Fusion86 commented 5 years ago

I started working on a .NET Standard port here. It looks like you can't import DLL's from subfolders in .NET Standard. My port seems to work fine on the CPU and the GPU, but it is still limited to Windows (for now) because all the included pre-compiled libraries (dependencies) are obviously only made for Windows.

tinohager commented 5 years ago

Can we set the target Framework to this?<TargetFrameworks>net45;net461;netstandard2.0</TargetFrameworks>

Yes my librariers are pre-compiled for windows. I need a solution to compile it for both systems. For example a docker container compile the librariers.

Fusion86 commented 5 years ago

Is there a specific reason why you also want it to specify net461? Since netstandard2.0 is already compatible with net461.

tinohager commented 5 years ago

yes if you install a .netstandard dll in a .net 4.6.1 project you have many extra dlls. I like less :)

alexgurenko commented 5 years ago

I started working on a .NET Standard port here. It looks like you can't import DLL's from subfolders in .NET Standard. My port seems to work fine on the CPU and the GPU, but it is still limited to Windows (for now) because all the included pre-compiled libraries (dependencies) are obviously only made for Windows.

Hello! Did you manage to adapt your fork for Linux? I want to try running this on Jetson Nano )

Fusion86 commented 5 years ago

No, I never got that far (since my most powerful PC is on windows I didn't really care). But if I remember correctly the the only thing (in theory) that needs to happen is to compile yolo_cpp_dll for linux. The only problem is that there is no makefile or anything like that for it, just a visual studio project. Now this is the point where I stopped caring about making it work for linux, so I don't know how hard it would be to compile for linux (maybe feeding the files to gcc works just fine, or maybe you need to edit the source a bit since it was made specifically for windows). I might try to look into this soon, but I wouldn't hold my breath.

tinohager commented 5 years ago

the yolo_cpp_dll can compile for linux check this How to compile on Linux

tinohager commented 5 years ago

I have no linux enviorment for testing i have only my windows system

alexgurenko commented 5 years ago

Thanks for advice, @Fusion86, @tinohager ! I already have yolo_cpp_dll for linux-arm64. I will try it in near time