Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wschoi89 opened this issue Feb 14, 2017 · 62 comments
Closed

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

wschoi89 opened this issue Feb 14, 2017 · 62 comments

Comments

@wschoi89
Copy link

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
Copy link
Member

ZheC commented Feb 14, 2017

ZheC/Realtime_Multi-Person_Pose_Estimation#5 may be helpful.

@zhangyunming
Copy link

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
Copy link
Member

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
Copy link

Zehaos commented Apr 14, 2017

is windows version in progress?

@gineshidalgo99
Copy link
Member

gineshidalgo99 commented Apr 16, 2017

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

@hemecha
Copy link

hemecha commented May 2, 2017

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
Copy link
Member

gineshidalgo99 commented May 2, 2017

  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
Copy link

hemecha commented May 2, 2017

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
Copy link
Member

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
Copy link

hemecha commented May 2, 2017

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

@hemecha
Copy link

hemecha commented May 9, 2017

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
Copy link

hemecha commented May 9, 2017

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

@xiaosibai
Copy link

xiaosibai commented May 9, 2017 via email

@hemecha
Copy link

hemecha commented May 9, 2017

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
Copy link

orientalh commented May 11, 2017

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
Copy link

hemecha commented May 11, 2017

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
Copy link

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
Copy link

hemecha commented May 12, 2017

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
Copy link
Member

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
Copy link

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
Copy link

Hi,

In my case, I follow these steps:

  • Create an empty project in visual studio and add all the sources and headers files.
  • Enable Cuda to compile .cu files
  • Generate the openpose.lib
  • Make sure you enable all the flags needed (you can get it from caffe library and openpose (Linux script))

For the examples (rtpose):

  • Add new empty project
  • Add the source file .rtpose
  • Set up the linker (you can use the same libraries from Caffe) and the include files.

@AntonN11
Copy link

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
Copy link

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
Copy link
Member

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
Copy link

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

@helen-medina
Copy link

helen-medina commented May 16, 2017 via email

@helen-medina
Copy link

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
Copy link

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
Copy link

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.

@helen-medina
Copy link

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
Copy link

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:

  • Build the solution in release mode (as I have found some issues in debug mode)
  • Enable Cuda from project ->build customization
  • Once Cuda is enable add the .cu files
  • Also, add othe flags to the project ->properties->preprocessor:
    USE_CUDNN
    USE_OPENCV
    USE_CAFFE
  • Check if you have included the paths for the includ files for: caffe, cuda, opencv and openpose.
    I hope it helps.

@orientalh
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@AntonN11
Copy link

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
Copy link

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
Copy link

👍
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
Copy link

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

@helen-medina
Copy link

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
Copy link

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
Copy link

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
Copy link

Perfect, I'll try that. Thank you.

@orientalh
Copy link

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
Copy link

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

@orientalh
Copy link

Hi

  1. I want to use "only CPU" not to use GPU.
    What should i do??
    Do i change the build_win.cmd and build caffe again??
    Actually i do not understand how to change flag

  2. I have a error when i compile and run.
    image

I guess it is because of GPU version.

Then what should i do to solve this error??

@gineshidalgo99
Copy link
Member

gineshidalgo99 commented May 23, 2017

I am sorry but the CPU version is not finished (and not planned to be finished due to be extremely slow), it would give you a exception with a message: code not implemented or something similar.

@AntonN11
Copy link

AntonN11 commented May 23, 2017

Good news! I got it to work on Windows 👍
image

image

I tried the example using a couple of images and it worked. For some obscure reason(s), it will only work if I call it in cmd line.

@helen-medina
Copy link

helen-medina commented May 23, 2017 via email

@helen-medina
Copy link

helen-medina commented May 23, 2017 via email

@AntonN11
Copy link

So far so good. I tried a gtx980 and my max fps is 7.3. For some reason, I can only get up to 6.1fps on a M6000 Quadro... I have to figure out why it doesn't work with the video ".avi" file or the webcam.

@orientalh
Copy link

orientalh commented May 24, 2017

Hi,
I continue to run Openpose.
When i run the openpose.cpp, I had this error (errorMessageToPropagate "\nError:\nVideoCapture (video) could not be opened for path: 'examples/media/video.avi'.\n\nComing from:\n- ..\..\..\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader(... std::basic_string<char,std::char_traits,std::allocator >)

I guess this error is occurred because of path. I write code like this
image

Is this way is wrong?? or should i write more path on other line??

How should i run on video mode??

@AntonN11
Copy link

If anyone finds a way to get up to 30fps, let us know how you did it.
With "MPI_4_layers", I get 9.8fps on a GTX980.

@gineshidalgo99
Copy link
Member

We will release a faster model in 1-3 weeks, it should get ~30-50% speed up. That + reducing --net_resolution should give the main boosts.

@AntonN11
Copy link

Good to know. Thank you.

@AntonN11
Copy link

Alright. Using a smaller net_resolution (320x176), I got 20.5fps (GTX980 + MPI_4_layers)! the detection is not bad, but there is a difference.

@gineshidalgo99
Copy link
Member

gineshidalgo99 commented May 24, 2017

Please, from now on, keep asking all these questions though the Pull Request created by Helen. So we can have only 1 centralized message thread for Windows until we release it.
CMU-Perceptual-Computing-Lab/openpose#28
I will delete any further message on this thread non-related with a previous post. Thanks and sorry for any inconvenience!

UPDATE: The Windows branch has been added to OpenPose: https://github.com/CMU-Perceptual-Computing-Lab/openpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants