CMU-Perceptual-Computing-Lab / caffe_rtpose

Realtime C++ code for multi-person pose estimation
Other
356 stars 207 forks source link

is it possible to run caffe_rtpose on window system? #17

Closed wschoi89 closed 7 years ago

wschoi89 commented 7 years ago

I compiled caffe window version on window environment but I don't know it is possible to compile caffe_rtpose. Could you give me some advises about this problem?

ZheC commented 7 years ago

https://github.com/ZheC/Realtime_Multi-Person_Pose_Estimation/issues/5 may be helpful.

zhangyunming commented 7 years ago

i have build the caffe_rtpose success on windows7 vs2013,but the code of the rtpose.cpp in example is too heavy , i have not fixed it correctly.

gineshidalgo99 commented 7 years ago

Sorry to hear that. We will release in around 1-1.5 months a new optimized version which also removes all Unix libraries, so you will be able to compile it on Windows.

Zehaos commented 7 years ago

is windows version in progress?

gineshidalgo99 commented 7 years ago

The new version (no Unix dependencies other than Caffe) will be released within 1-2 days. Sorry for the inconveniences.

hemecha commented 7 years ago

Hi everyone! I can see some people have been able to compule the project caffe_rtpose in Windows. Could you please give some instructions what is needed? That would be very helpful.

Regarding to the new version of the project, coul you please confirm me if it is already released?

Thanks in advance!

gineshidalgo99 commented 7 years ago
  1. Windows: I am also interested if someone did it (the new version has no Windows dependencies other than Caffe itself).

  2. New version: It has been released! https://github.com/CMU-Perceptual-Computing-Lab/openpose

hemecha commented 7 years ago

Thank you for the information. I am still trying to build it in Windows. Just to double check, once caffe is installed in windows, I should be able to build the new version of the project caffe_rtpose in windows without code changes, is it correct?

Thanks in advance. Kind regards,

Helen

gineshidalgo99 commented 7 years ago

I did not try it, but yeah, it should run, we do not use any Unix instructions as we are doing here If you find any compiling errors when building it, please let us know and we will help you! If you are able to compile it, if you could send us the basic steps so we can add them to our doc we will highly appreciate it!

hemecha commented 7 years ago

Ok, no problem. Thank you very much for your help :)

hemecha commented 7 years ago

Hi, I would like to ask you a question about the openpose examples. I am trying to run the example rtpose.cpp for a video, but it seems it only runs from a camera. However, the old version of the library, the demo can run from a camera or from a video. Could you tell me how I could run it from a video please?

Note: I have already pass the parameters --video /examples/media/video.avi

Code of the source rtpose.cpp from the new openpose library:

int main(int argc, char *argv[]) { // Initializing google logging (Caffe uses it for logging) google::InitGoogleLogging("opRealTimePoseDemo");

// Parsing command line flags
gflags::ParseCommandLineFlags(&argc, &argv, true);

// Running opRealTimePoseDemo
return opRealTimePoseDemo();

}

hemecha commented 7 years ago

It is possible to run a video from the demo. But, thanks anyway. Regards

xiaosibai commented 7 years ago

Can you give the data you used to train for the model? I find 189G mdb file from your URL but cannot find raw data.

Regards

------------------ 原始邮件 ------------------ 发件人: "hemecha";notifications@github.com; 发送时间: 2017年5月9日(星期二) 下午4:27 收件人: "CMU-Perceptual-Computing-Lab/caffe_rtpose"caffe_rtpose@noreply.github.com; 抄送: "Subscribed"subscribed@noreply.github.com; 主题: Re: [CMU-Perceptual-Computing-Lab/caffe_rtpose] is it possible to runcaffe_rtpose on window system? (#17)

It is possible to run a video from the demo. But, thanks anyway. Regards

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

hemecha commented 7 years ago

Hi xiaosibai, I am not sure if the question is for me. But, in order to use the demo I haven´t trained any model. I have just download the model COCO from the url: http://posefs1.perception.cs.cmu.edu/Users/tsimon/Projects/coco/data/models/coco/pose_iter_440000.caffemodel

Regards

orientalh commented 7 years ago

Hi hemecha, I have some questions. I read your comment to run openpose on window.

  1. When you run it on window, do not use ubuntu?? Should i use Cmake to run it on window?

  2. Do you only install CUDA, cudnn and OpenCV which are window version??

  3. Can i build it using visual studio? not using python??

  4. Should i need to install caffe on window??

5.. If you remember the procedure install and run openpose on window, please teach it for me.

Thank you to read my sentences and have a good day!

hemecha commented 7 years ago

Hi orientalh,

You can find below the answers to your question:

  1. When you run it on window, do not use ubuntu?? Should i use Cmake to run it on window? No, I haven´t use Ubuntu, you could install Ubuntu in a virtualBox, if you want to run it from Windows.
  2. Do you only install CUDA, cudnn and OpenCV which are window version?? Yes, you need all of them. The library Openpose depends on them. Also, you can find the instructions to install them in the url below : https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md
  3. Can i build it using visual studio? not using python?? Yes, you can Actually, I have built it from Visual studio.
  4. Should i need to install caffe on window? Yes, you need it. In this version of openpose, you can use your own caffe library.
  5. In order to run it from Windows, I have follow the instructions from the repo and the basic steps are:
    • Install CUDA, cudnn, caffe in Windows (instead Linux)
    • Create a project in visual studio and configure the project with the libraries dependences and libraries.
    • Configure CUDA properties in the project so Visual studio an compile the files .cu
    • Compile the library so the project will generate the openpose.lib.

With the authorization of the author, I will publish soon another branch with more details about how to set up the library in Windows. I will let you know once it is done.

Regards,

Helen

orientalh commented 7 years ago

Hi hemecha, thank you to reply

I have some questions about your reply

  1. When you run it on window, do not use ubuntu?? Should i use Cmake to run it on window? No, I haven´t use Ubuntu, you could install Ubuntu in a virtualBox, if you want to run it from Windows This sentence means that do i must use Ubuntu in a box, if i want to run it from Windows? Is there any methods do not use Ubuntu? If is possible how to run the examples such as Makefile.config.Ubuntu14_cuda_7.example.

  2. Which version do you use?? OpenCV3 or OpenCV2?? https://github.com/CMU-Perceptual-Computing-Lab/openpose#installation-reinstallation-and-uninstallation In Output, there is this sentence. "However, the JSON format is only available after OpenCV 3.0. Hence, write_pose_json saves the people pose data using a custom JSON writer" So do i use OpenCV3.0??

  3. Should i need to install caffe on window? Yes, you need it. In this version of openpose, you can use your own caffe library. I use CUDA8.0 and visual studio2015 then should i use caffe file on this(https://github.com/BVLC/caffe/tree/windows) or install caffe on Windows using this(https://github.com/Microsoft/caffe)?? Also could i use the caffe library in this opensource?? Do not make my own trainning data.

  4. My final goal is using openpose with openframeworks(http://openframeworks.cc/) which is based C++ and visual studio. You said "Compile the library so the project will generate the openpose.lib" If i get openpose.lib then can i use openpose(tracking joints) in openframeworks??

Thank you very much^^

hemecha commented 7 years ago

Hi orientalh,

I am still working in this project, so probably I won´t be able to answer all your questions, but I will try.

Question 1. You don´t need Ubuntu, you can use visual studio instead. I recommend you use Visual studio 2015, because the library has enabled the c++11 features. So, as far as I know visual studio 2015 supports c++11. Lower version may not work very well.

Question 2. I use OpenCV3.10. Actually if you follow the instructions to install caffe in Windows. The script download all the dependencies it needs to install Caffe in Windows.

Question 3. Yes you need to install Windows in Visual Studio 2015,because Visual Studio 2013 doesn´t support all c++11 features, so it will give you issues during the compilation of the library. (https://github.com/BVLC/caffe/tree/windows).

Question 4. I don´t see why you cannot do that. You can also modify the library to meet your requirements. But, I think the authors of the library can answer you better this question.

I hope it helps.

Regards.

gineshidalgo99 commented 7 years ago

Hi @orientalh, we are working with hemecha in order to release a Windows version soon. You are free to either try to implement it yourself too or you might simply wait for us to release a first version, up to your priorities! Thanks!

orientalh commented 7 years ago

Hi hemecha and gineshidalgo99 Thanks to reply and i am happy to hear that releasing a window version soon. But i should use it this week, so i try to use this on window.

Actually i install visual studio2015, opencv3.1, cuda8, cudnn5 and caffe on window10. but i do not know how to install openpose and use openpose examples on window.

At first i just want to run demo with webcam on window. In the doc the instruction is "/build/examples/openpose/openpose.bin."

How can i run this demo on window?? Can you give me some guidelines?

Thank you, and have a nice day^^

helen-medina commented 7 years ago

Hi,

In my case, I follow these steps:

For the examples (rtpose):

AntonN11 commented 7 years ago

Hi guys,

I was able to install and run Caffe on Windows. I'm now trying compile and run OpenPose. I'm using CUDA 8 in VS2015 on Windows 10. When compiling, I get errors with nmsBase.cu and poseRenderGpu.cu. I updated to the latest version of OpenPose, but this didn't work. Thanks for the help. image

AntonN11 commented 7 years ago

I declared M_PI = 3.1416 and casted the other variables. I'm now trying to fix the new 159 errors I get. I also had to #define USE_CAFFE.

gineshidalgo99 commented 7 years ago

I am currently refining and preparing a first release for OpenPose on Windows. I hope to release it by this week. I want to only force people to install as few things as needed. Thank you for using OpenPose!

AntonN11 commented 7 years ago

Alright, thank you for the quick reply. I'm still trying to make it work.

helen-medina commented 7 years ago

Hi,

I had that issue as well. I fixed adding:

define _USE_MATH_DEFINES

include

I worked for me.

Regards,

Helen

On 16 May 2017 at 21:30, AntonN11 notifications@github.com wrote:

Alright, thank you for the quick reply. I'm still trying to make it work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/issues/17#issuecomment-301906042, or mute the thread https://github.com/notifications/unsubscribe-auth/ADrfhLU8b6C7hfFbs14TzwLZoc_Oj5INks5r6gdIgaJpZM4MANCH .

helen-medina commented 7 years ago

Hi Ginés,

I can see Openpose has different parameters to configure it. Could you tell me please if there is an specific parameter to improve the optimization of the program?

Thanks in advance.

AntonN11 commented 7 years ago

I got it to compile and run in VS2015, Release, x64 and Cuda8 . The thing is -> I get an access violation : image

Exactly here : image

helen-medina commented 7 years ago

Hi,

You could change "unsigned char" for "unsigned int". It worked for me. Not sure why "unsgined char" raise the exception, it should work. If someone knows it, please let me know.

If you apply the change above, probably you will need to make some changes in order to compile the library. However, they are minor changes, only change "unsigned char" for "unsigned int".

const std::map<unsigned int, std::string> POSE_COCO_BODY_PARTS {...} const std::map<unsigned int, std::string> POSE_MPI_BODY_PARTS{ ...} ...

Regards.

AntonN11 commented 7 years ago

Good. Thank you for your help Helen, I'll try that.

AntonN11 commented 7 years ago

I'm still having an access violation error : image I'll try to run a Debug version.

orientalh commented 7 years ago

Hi, helen-medina Thank to reply for using visual studio to use OpenPose.

  1. I make a new project using visual studio and add source and header files like the picture.

And i build the solution i have many errors. How can i solve it. image

I solves errors because of cuda. But i already have errors about caffe. How do you install caffe?? How to build "install_caffe.sh" on visual studio??

  1. I do not understand the sentence "Make sure you enable all the flags needed (you can get it from caffe library and openpose (Linux script))"

Is it mean using Cmake?? Or what should i do for it?

  1. Do you use Cmake? for build Makefile.config.Ubuntu14_cuda_7.example??

Have a good day!

AntonN11 commented 7 years ago

I'm now able to run in Debug mode. For some reason, the "POSE_COCO_BODY_PARTS" and "POSE_MPI_BODY_PARTS" variables are empty :(... image

orientalh commented 7 years ago

Hi, I have some questions to build OpenPose on windows using visual studio.

I made a new project and add source&header code. Then i made environment to use .cu files.

I also install caffe like this Download it from here (https://github.com/Microsoft/caffe) and build it. Then i had caffe.lib, caffe.exe, etc. like figure image

I copy these files and add them in the '3rdparty' folder. and Link .lib and .dll address on visual studio.

Question1. Is this way is correct to install caffe??

Then i compile openpose.cpp, I had a lot of errors. like figure image

Question2. How solve the errors?? I guess these errors are because install caffe is wrong or i did not install openpose.

Please give me some tips to use OpenPose. Thank you!

helen-medina commented 7 years ago

Hi AntonN11,

That variables shouldn't be empty, because they are initialized. Probably, that issue is related with the debug mode (not sure). However, if you are in a hurry you could comment out the variable POSE_BODY_PART_MAPPING and wherever it is used, you can replace it with the model pose defined for coco or MPI.

I hope it helps.

helen-medina commented 7 years ago

Hi orientalh, Caffe seems to be installed correclty. The errors you have it seems they are related because caffe flag is not enabled. So you need to add to the project the flag USE_CAFFE. You will find these flag in the script Makefile.config. If you still have issues with cuda, I suggest to check the following steps:

orientalh commented 7 years ago

Hi, AntonN11

I had a same access violation error. image

I change "char" -> "int" BUT i don't understand "the "POSE_COCO_BODY_PARTS" and "POSE_MPI_BODY_PARTS" variables are empty".

How do you solve this error???

helen-medina commented 7 years ago

Hi everyone,

I have just verified in another machine, that as you have said before the variables are empty. It seems they are empty because for some reason the system is using POSE_BODY_PART_MAPPING, before defining POSE_COCO_BODY_PARTS. In my old environment it seems to work (I don´t know how). When building the project I did some changes, but I can´t find out which one fix the issue. However, check the order of the headers, the building options of visual studio.

If I am able to fi the issue I will let you know.

Regards.

AntonN11 commented 7 years ago

Here is how I got "fixed" the empty variable : image

I'm now stuck with an "vector index out of range" with the 4 threads. I'll try and run with a single thread. Keep giving inputs people, we'll get there!

AntonN11 commented 7 years ago

And thank you for your help helen-medina, I appreciate it.

AntonN11 commented 7 years ago

I have passed the thread/queue issue. I had to "+ 1" over here : image

Otherwise, the "usedQueueIds" was read out of bounds.

Afterwards, I needed to find and copy the "models" folder : image

I also added this file "pose_iter_440000.caffemodel" in "models/pose/coco".

In the end, the app crashes with this error : "nError:\nCuda check failed (7 vs. 0): too many resources requested for launch\n\nComing from:\n- C:/.../openpose-master/src/openpose/pose/poseRenderGpu.cu:op::renderPoseGpu():440\n- C:/.../openpose-maste... std::basic_string<char,std::char_traits,std::allocator >

helen-medina commented 7 years ago

That error could be caused because the card graphic is not supported by the Cudann. In order to run Cudann, you need at least compute capabality 3.0. You can check here below the minimum requirements:

https://developer.nvidia.com/cudnn In the below link you can check your compute capability of your machine https://developer.nvidia.com/cuda-gpus#collapse4

AntonN11 commented 7 years ago

👍 Ok, so it's a parameter with Cuda I guess. Here is what's installed on my computer :

image

It's a 5.2 "compute capacity" card. Some parameter is not set right.

AntonN11 commented 7 years ago

Maybe a bad Caffe compilation, Cuda configuration flag...

helen-medina commented 7 years ago

You configuration seems correct. I had a similar issue related with caffe, but it wasn´t any flag. The caffe last version was failing, so I took the version released 1.0.

You could try that. When compiling caffe, enable Cuda compilation : project ->build customizations-> enable cuda and built it.

The rest of flag should be OK. I hope it helps.

AntonN11 commented 7 years ago

Good to know. I'm using this Caffe version : https://github.com/BVLC/caffe/tree/windows. I believe it's a 1.0.0 version of Caffe. I have updated a week ago when compiling a Debug version. The thing is, I'm compiling using the provided script and these parameters :

image

And here is what I get when executing this command file :

image

I guess I'll try to compile a Caffe version using VS2015 directly (with Cuda compilation). See if it helps.

helen-medina commented 7 years ago

In my case I didn´t used Ninja. I used Visual studio 2015 and miniconda (I had issues with python). The rest of the parameters seems correct. I upload a branch for windows , it is not finished because it had some issues, but some of them has been fixed for you (Thank you very much for that).

In this link below you can check the parameters I used to build caffe, but your seems correct as well: https://github.com/helen-medina/openpose/tree/windows/3rdparty/caffe/caffe-windows/scripts

Regards.

AntonN11 commented 7 years ago

Perfect, I'll try that. Thank you.

orientalh commented 7 years ago

Thank you AntonN11 and helen-medina

I solve empty variable error because of yours!

However i had another error. image

I search error about ucrtbase.dll, however i do not know why it happens...

If do you have this error and solve. Please teach me!

One more time thanks very much!!

AntonN11 commented 7 years ago

It seems like it's the same problem as I'm stuck at, but in Release mode.