elucideye / acf

Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0 based on https://github.com/pdollar/toolbox
BSD 3-Clause "New" or "Revised" License
49 stars 20 forks source link

Any suggestion for compiling acf through JNI under Android studio #50

Closed ygyin-ivy closed 6 years ago

ygyin-ivy commented 6 years ago

i'm a newbie to hunter-pack, and tried to compile acf on ubuntu, but failed.

My goal is to understand how acf or drishti can detect face and compile it under android studio,

any suggestion for this?thx

headupinclouds commented 6 years ago

and tried to compile acf on ubuntu, but failed.

What was your build command and what was the failure?

ACF should build fine via Hunter with any NDK + C++11 toolchain in polly. The last toolchain in these CI jobs is an Android build, for example:

https://travis-ci.org/elucideye/acf/builds/364195910

You can check the .travis.yml file for the build details or select another suitable android toolchain from https://github.com/ruslo/polly. If you build a shared lib you could add that to your Android Studio project.

compiling acf through JNI under Android studio

Another option is to manage dependencies through Hunter directly using Android Studio's updated CMake support. That seems to be closer to what your asking for, and it will provide a lot more flexibility. Until recently, this wasn't possible, as Android bundled a custom CMake that didn't work well with Hunter (at least not easily). The recent Android Studio releases have experimental support for standard CMake builds, but I believe this was introduced only in Android Studio 3.2 Canary X releases.

For a working example you can clone this sample project by @ruslo:

https://github.com/forexample/android-studio-with-hunter

That has a good skeleton for the basic setup and it takes cares of some of the toolchain related logic that is required to use Hunter.

I've used that with success, but this is still "bleeding edge" and I know there have been various glitches (unrelated to Hunter) in each Canary channel update. If you can live with that, I would recommend trying it, as it should be part of standard releases in the near future. Let me know if that helps.

ygyin-ivy commented 6 years ago

thx, i will try those.

headupinclouds commented 6 years ago

👍 Closing for now.