takuya-takeuchi / OpenPoseDotNet

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

Usage in macOS for Xamarin #20

Open Lingfeng158 opened 4 years ago

Lingfeng158 commented 4 years ago

Hi takuya-takeuchi,

I'm new to .net platform, and I'm currently using Xamarin (from visual studio for Mac) to develop apps for iOS and Android. Since it is a .net package, I just assumed that it will also work in Xamarin. So here are my questions:

  1. Can we build the project with CPU only? Is <cpu/cuda> choosing either cpu or cuda?
  2. Can you please explain the parameters used in the build command Build.ps1 <Debug/Release> <cpu/cuda> 64 desktop <2015/2017/2019> <92/100/101> What does desktop <2015/2017/2019> <92/100/101> mean?

Thank you very much!

takuya-takeuchi commented 4 years ago

@Lingfeng158

I'm very sorry. I didn't check osx build work for a long time.

Build.ps1 does not support Linux and OSX. You can use https://github.com/takuya-takeuchi/OpenPoseDotNet/blob/master/src/BuildMacOSX.sh.

$ ./BuildMacOSX.sh Release

And this script support only cpu. Because I have no osx machine with nvidia gpu.

Lingfeng158 commented 4 years ago

I'm sorry that I pose multiple questions consecutively, but I'm a bit confused about the overall usage of your project, as I'm very new to .net and NuGet systems. Currently I hold a few questions about the project:

  1. After build the project using src/BuildMacOSX.sh, I can find all the files in src/OpenPoseDotNet in Visual Studio. I would like to try out OpenPoseDemo, but I wasn't able to find any quick start guide for macOS. How should I use OpenPoseDemo under macOS?

  2. Other tutorials start with executable or binary of OpenPose, but openposeDotNet it is a .NET Standard library, I assume that there is no executable for macOS? Then how should I use the library to make predictions?

  3. What I would like to achieve is to input pictures of body and output coordinates of joints; input pictures of a face and output coordinates of the face. Could you please give me some suggestions/directions on using the library?

Thank you very much, and again, I'm deeply sorry for posting/editing/deleting my post repeatedly.

takuya-takeuchi commented 4 years ago

@Lingfeng158

  1. After run BuildOSX.sh, you find libopenpose.dylib but I can not current develop branch.

  2. openposeDotNet is library, And you can use in your .NET core apps. You can build examples and run it by using openposeDotNet.dll and libopenpose.dylib. But due to 1., it is expectation.

  3. These examples could satisfy your requirements.

takuya-takeuchi commented 4 years ago

@Lingfeng158 Latest develop branch support osx cpu binary.

$ cd nuget
$ pwsh BuildOSX.ps1
$ ls -ls artifacts/cpu/runtimes/osx-x64/native/
total 25640
2200 -rwxr-xr-x  1 t-takeuchi  staff  1123232 Aug 14 11:03 libOpenPoseDotNetNative.dylib
5472 -rwxr-xr-x  1 t-takeuchi  staff  2798824 Aug 14 10:46 libcaffe.1.0.0.dylib
5472 -rwxr-xr-x  1 t-takeuchi  staff  2798824 Aug 14 10:46 libcaffe.dylib
6248 -rwxr-xr-x  1 t-takeuchi  staff  3195368 Aug 14 10:51 libopenpose.1.6.0.dylib
6248 -rwxr-xr-x  1 t-takeuchi  staff  3195368 Aug 14 10:51 libopenpose.dylib
Lingfeng158 commented 4 years ago

Thank you for your efforts and response! I will take a look!

JaxkDev commented 9 months ago

I Cant seem to build using develop and BuildOSX.ps1

user@MacBook-Air-2 nuget % pwsh BuildOSX.ps1
Build OpenPoseDotNet.Native [x64] for cpu
Start Build openpose
   cmake -D CMAKE_BUILD_TYPE=Release 
         -D USE_CUDA:BOOL=OFF 
         -D GPU_MODE=CPU_ONLY 
         /Users/user/Desktop/opdn/src/openpose
   cmake --build . --config Release
End Build openpose
Start Build OpenPoseDotNet.Native
   cmake -D BUILD_SHARED_LIBS=ON 
         ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-------------------------------------------------------
-- CMAKE_SYSTEM_INFO_FILE: Platform/Darwin
-- CMAKE_SYSTEM_NAME:      Darwin
-- CMAKE_SYSTEM_PROCESSOR: arm64
-- CMAKE_SYSTEM:           Darwin-22.6.0
-- CMAKE_C_COMPILER:       /Library/Developer/CommandLineTools/usr/bin/cc
-- CMAKE_CXX_COMPILER:     /Library/Developer/CommandLineTools/usr/bin/c++
-- os_version_suffix:      
-- Project: /Users/user/Desktop/opdn/src/OpenPoseDotNet.Native
-- Binaries: /Users/user/Desktop/opdn/src/OpenPoseDotNet.Native/build_osx_desktop_cpu_x64
-------------------------------------------------------
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/user/Desktop/opdn/src/OpenPoseDotNet.Native/build_osx_desktop_cpu_x64
gmake[2]: *** No rule to make target 'openpose/src/openpose/libopenpose.dylib', needed by 'libOpenPoseDotNetNative.dylib'.  Stop.
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/OpenPoseDotNetNative.dir/all] Error 2
gmake: *** [Makefile:111: all] Error 2