takuya-takeuchi / OpenPoseDotNet

OpenPose wrapper written in C++ and C# for Windows
MIT License
66 stars 25 forks source link

Hi How to use the Nuget? #3

Open 599177227 opened 5 years ago

599177227 commented 5 years ago

Hello,I want to ask for instructions for how to use the openpose API,are there some suggestions or instrutions?

takuya-takeuchi commented 5 years ago

I'm verry sorry to trouble you. This product is just development phase. So there are some bug, issue and trouble. Please forgive me.

  1. Add Nuget package to your project
  2. Build
  3. Copy the following dependency libraries to output directory (Case: Windows)
599177227 commented 5 years ago

Oh!!!Thank you very much for your answer So now We only can execute the Openpose Demo , there is no API available for this NuGet package?

takuya-takeuchi commented 5 years ago

there is no API available for this NuGet package?

What does it mean? src/OpenPoseDotNet wrap openpose.dll. So there should is many openpose API.

OpenPose Demo is ported from https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/examples/openpose/openpose.cpp.

599177227 commented 5 years ago

Okay,I just don't know how to use the Openpose API, Is there a corresponding API document there or some imformation about it?

599177227 commented 5 years ago

And I don‘t Know how to use the OpenposeDonet, Can I use it to implement WPF programs? I hope that you could give me some instructions?

599177227 commented 5 years ago

And May I ask you for some other solutions ,I build the project ,but there are some errors as follwing: Error MSB3030: Unable to copy the file "C:\ Users \ 57726 \ source \ repos \ ConsoleApp3 \ packages \ OpenPoseDotNet.1.4.0.20190115 \ runtimes \ win-x64 \ native \ DlibDotNetNativeDnn.dll" because the file could not be found. My .NetFrame Version:4.72

takuya-takeuchi commented 5 years ago

Is there a corresponding API document there or some imformation about it? No document. But all api and class have similar with original name. So you could understand easily.

takuya-takeuchi commented 5 years ago

"C:\ Users \ 57726 \ source \ repos \ ConsoleApp3 \ packages \ OpenPoseDotNet.1.4.0.20190115 \ runtimes \ win-x64 \ native \ DlibDotNetNativeDnn.dll" because the file could not be found.

Ops. I'm very sorry to trouble you. I uploaded wrong package. Please give me time to correct.

takuya-takeuchi commented 5 years ago

Sorry. I unlisted package because there are many problems.... Please forgive me......

599177227 commented 5 years ago

It doesn't matter, the package you made is already very good. Thank you very much for your answer. Is the error above me because you uploaded the wrong package? Then how should I solve this error?

599177227 commented 5 years ago

After I added the two missing files, the program can run, but the console flashes back and then has the following problem in the output box: The exception thrown: "System.Exception" (located in OpenPoseDotNet.dll) The exception thrown: "System.DllNotFoundException" (located in ConsoleApp1.exe) Can you help me solve it?

takuya-takeuchi commented 5 years ago

Yes, I just fixed now and uploaded 1.4.0.20190117. But nuget package system is difficult and there may be other problems. Please let me know if you face problem.

Thank you for your cooperation.

599177227 commented 5 years ago

Okay,I am grateful for your patient answers。 best wish to you

599177227 commented 5 years ago

I am very sorry to trouble you again,I follow the installing steps you give ,but i meet the problem in the first step,I failed to open the BuildWindowsVS2015 on Console windows,the problew as folling :

problem

takuya-takeuchi commented 5 years ago

You must execute in root directory to restore openpose before build openpose.

git submodule update --init
599177227 commented 5 years ago

Please forgive my ignorance,I don‘t what you meant,how to excute ?and what is git submodule updata ,I can’t found it on my root directory to restore openpose.

takuya-takeuchi commented 5 years ago

ok. Do you install git on windows? You must install git!!

  1. move to OpenPose Root dir
    cd D:\
    git clone -b 1.4.0.20190117 https://github.com/takuya-takeuchi/OpenPoseDotNet
    cd OpenPoseDotNet
  2. execute this command to restore D:\OpenPoseDotNet\openpose dir. openpose dir is git submodule directory. This diretory links https://github.com/CMU-Perceptual-Computing-Lab/openpose
    git submodule update --init
  3. Build openpose
    BuildWindowsVS2015.bat
599177227 commented 5 years ago

Oh thanks, I got it according to the method you said, but now I can run it, but I still get an error and I have two files missing. Do you know what the reason is? image

takuya-takeuchi commented 5 years ago

please show whole error message

599177227 commented 5 years ago

And if I build and execute the OpenposeDemo,There are also some problems as follow: image image

takuya-takeuchi commented 5 years ago

WholeBodyFromImage must be specified image file path.

dotnet run -c Release -i "c:\test.bmp"

And do you install Visual Studio 2015 with C++? I have never seen this problem. But if you install visual studio 2017, you can modify BuildVS2015.bat and it is available.

599177227 commented 5 years ago

yes ,I install the visual studio 2017 ,So is there something I should do to modify BuildVS2015.bat.

takuya-takeuchi commented 5 years ago

In bat file,

cmake -G "Visual Studio 14 2015 Win64" ^

to

cmake -G "Visual Studio 15 2017 Win64" ^
599177227 commented 5 years ago

OKay ,thank you very much for your answer!

599177227 commented 5 years ago

Hello,I am very sorry to trouble you again,I met the problem when I use the OpenPose NuGet. I bulit the project and reference the NuGet Package,then I copy All Codes from one example of Your OpenPoseDemo(KeyPointsFromImageConfigurable),in the end I build the prroject , the project will show a console Windows in a flash ,the information was listed below,and I try to use console to build the project, That won't work. the detail information as following: image image

I don‘t know how to make it,Could you help me out ? Thank you very much!!

takuya-takeuchi commented 5 years ago

You 'ONLY' copy demo project to other directory? If so, you must modify ****.csporj.

Because sample project refers OpenPoseDotNet project by relative path. So copied project could not read OpenPoseDotNet project.

And could you translate error message to english or paste error message here? I cannot understand Chinese and input it to translater because I don't know how to read them. (I am Japanese. But some Chinese words are not used in Japan. so I cannot input!!)

599177227 commented 5 years ago

Sure,The red font are translated to follow: Wúfǎ yùnxíng xiàngmù qǐng quèbǎo nǐ jùyǒu kě yùnxíng de xiàngmù lèixíng qiě “dotnet run” zhīchí cǐ xiàngmù. Kě yùnxíng de xiàngmù yīng miànxiàng kě yùnxíng de TFM(lìrú netcoreapp2.0) Qiě qí OutputType wèi “Exe“. Dāngqián de OutputType wèi”Exe“ 展开 114/5000 Unable to run project Make sure you have a working project type and "dotnet run" supports this project. A runnable project should target a runnable TFM (for example, netcoreapp2.0) and its OutputType is "Exe". The current OutputType is "Exe"

I don't exactly what you meant,my root directory don’t have any ****.csporj file.

Could you Download My project in my reposiyories,and try to run it.

599177227 commented 5 years ago

I don't exactly know what you meant,my root directory don’t have any ****.csporj file.

599177227 commented 5 years ago

If my expression makes you unable to understand, please forgive my limited English level.

takuya-takeuchi commented 5 years ago

If my expression makes you unable to understand, please forgive my limited English level.

Don't worry. My english is also not good. :)

Could you Download My project in my reposiyories,and try to run it.

OK. Where is your repository? Is it correct ? https://github.com/599177227/FacialDetected

599177227 commented 5 years ago

No ,that is wrong ,the file which is named OpenposeBody is uploading ,please wait .

599177227 commented 5 years ago

Now it is Ok, you can download at the Release Page in Openpose .please help me check it ,thank you !

takuya-takeuchi commented 5 years ago

OK. OpenposeBody is created as .NET Framework 4.7.2 project. But our sample is created as .NET Core console app.

So dotnet commands does not work for OpenposeBody. You should re-create project as .NET Core console app if you want to use dotnet command.

599177227 commented 5 years ago

Thank you ,I have received it,I will give it a try.

599177227 commented 5 years ago

Hello, can I ask a question about the C++ API used in C#? I used the openpose source code and compiled the first API dll. I introduced it to my C# code, but it reported this error. Have you ever met it? I don't know what is configured less? can you help me? image image image

599177227 commented 5 years ago

thank you sincerely!

takuya-takeuchi commented 5 years ago

OpenPose needs Caffe model files. This files are generated when building openpose. (Not building OpenPoseDotNet!!!!) Please check OpenPoseDotNet\openpose. You could see model directory.

And copies model directory to application root directory. In your case, it is x64\Debug.

599177227 commented 5 years ago

Thank you very much for solving a problem that I have not been able to solve. Thank you very much!

599177227 commented 5 years ago

Hi,friend,there is another problem bothered me thoese days,Why my project sometimes run so well,but sometime it will occur error and I can‘t fit it,I don’t know why and how to solve it ,could you give me some instrutions about it ,the problem as following : image

takuya-takeuchi commented 5 years ago

Is it OpenPoseDotNet sample? It looks like to be https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/examples/tutorial_api_cpp/01_body_from_image_default.cpp. I have no idea to resolve issue.

But it indicates https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/include/openpose/core/wScaleAndSizeExtractor.hpp#L68. It seems input image becomes sometimes empty size. It may be OpenCV issue.

599177227 commented 5 years ago

No,it is not a sample of OpenPoseDoNet,I only want to wrapper the C++ to the dll for C#,but if I set the fuction return a void ,this is ok, if I set it to return cv::Mat,that is a Unknow problem,the detail codes as following : image ![Uploading image.png…]()

I now implement a painting of the image by calling a C++ .dll file and saving it to a local path, but I can't return cv::mat type or byte* directly to C#, so I can only wait for it to finish painting. Local reading will increase the running time. Do you have any way to solve it?

599177227 commented 5 years ago

image

takuya-takeuchi commented 5 years ago

System.DllNotFoundException

It means there is not 01_body_From_image_default.dll or it's depenecies lib. How about using dependency walker to inspect missing library?

599177227 commented 5 years ago

Okay,Thank you for your advice,谢谢!

YuBin8 commented 1 year ago

boost_chrono-vc140-mt-1_61.dll boost_filesystem-vc140-mt-1_61.dll boost_python-vc140-mt-1_61.dll boost_system-vc140-mt-1_61.dll boost_system-vc140-mt-gd-1_61.dll boost_thread-vc140-mt-1_61.dll caffe.dll caffehdf5.dll caffehdf5_hl.dll caffezlib1.dll cublas64_80.dll cudart64_80.dll cudnn64_5.dll curand64_80.dll gflags.dll gflagsd.dll glog.dll glogd.dll libgcc_s_seh-1.dll libgfortran-3.dll libopenblas.dll libquadmath-0.dll opencv_core310.dll opencv_ffmpeg310_64.dll opencv_imgcodecs310.dll opencv_imgproc310.dll opencv_world310.dll opencv_world310d.dll openpose.dll python27.dll VCRUNTIME140.dll

where are these file?

takuya-takeuchi commented 1 year ago

@YuBin8 You have to build. Please check https://github.com/takuya-takeuchi/OpenPoseDotNet#1-build

YuBin8 commented 1 year ago

@takuya-takeuchi thanks, but when i run build , it say
Cant Not Found Type [Config]。

takuya-takeuchi commented 1 year ago

@YuBin8 Did you used powershell core (or 7) rather than built-in powershell? I can not reproduce it.

YuBin8 commented 1 year ago

@YuBin8 Did you used powershell core (or 7) rather than built-in powershell? I can not reproduce it.

thank you so much for your patience,i was used built-in powershell, now when i run it in powershell core 7 sitll has some err

image

my vs version : Microsoft Visual Studio Community 2019 16.11.19 vc++ version image

takuya-takeuchi commented 1 year ago

@YuBin8 You must install Cmake from https://cmake.org/download/