{"id":15047896,"url":"https://github.com/elucideye/acf","last_synced_at":"2025-04-10T01:06:58.137Z","repository":{"id":72279661,"uuid":"104651900","full_name":"elucideye/acf","owner":"elucideye","description":"Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0 based on https://github.com/pdollar/toolbox","archived":false,"fork":false,"pushed_at":"2019-04-29T15:47:06.000Z","size":432,"stargazers_count":49,"open_issues_count":15,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-10T01:06:39.056Z","etag":null,"topics":["acf","android","cmake","computer-vision","cplusplus","cplusplus-11","dollar","face-detection","hog","hunter","ios","matlab","object-detection","opencv","opengl","opengl-es","piotr","polly","simd","toolbox"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elucideye.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-24T14:50:19.000Z","updated_at":"2025-02-28T00:54:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"08a2a1dd-2ba6-43a6-baca-efb5c66a957d","html_url":"https://github.com/elucideye/acf","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elucideye%2Facf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elucideye%2Facf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elucideye%2Facf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elucideye%2Facf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elucideye","download_url":"https://codeload.github.com/elucideye/acf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137887,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acf","android","cmake","computer-vision","cplusplus","cplusplus-11","dollar","face-detection","hog","hunter","ios","matlab","object-detection","opencv","opengl","opengl-es","piotr","polly","simd","toolbox"],"created_at":"2024-09-24T21:05:52.563Z","updated_at":"2025-04-10T01:06:58.128Z","avatar_url":"https://github.com/elucideye.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"=== \nacf\n===\nAggregated Channel Feature object detection in C++ and OpenGL ES 2.0\n\n|TravisCI| |Appveyor| |License| |Hunter|\n\nThis module is very well suited to running real time object detection on mobile processors, where recent high performing but GPU needy DNN approaches aren't as suitable.  The ACF pyramids can be computed with the OpenGL ES 2.0 shaders and retrieved more or less for free (\u003c 1 frame time with 1 frame of latency).  For selfie video, the pretrained face detectors (see FACE80_ and FACE64_) run in a few milliseconds on an iPhone 7.  TODO: The Locally Decorrelated Channel Feature addition has not yet been added (see LDCF_), but the 5x5 kernels should map well to OpenGL shaders.  That should make performance very competitive (see Piotr's references for comparisons).\n\n.. _FACE80: https://github.com/elucideye/drishti-assets/blob/master/drishti_face_gray_80x80.cpb\n.. _FACE64: https://github.com/elucideye/drishti-assets/blob/master/drishti_face_gray_64x64.cpb\n.. _LDCF: https://arxiv.org/pdf/1406.1134.pdf\n\nSample 10 Channel ACF from GPU: LUV + magnitude (locally normalized) + gradient orientation (6 bins):\n\n.. image:: https://cloud.githubusercontent.com/assets/554720/21356618/4decbb4c-c6a0-11e6-8d8a-d1a3fc23c742.jpg\n\n- C++ implementation of `Fast Feature Pyramids for Object Detection`_ (see `Piotr's Matlab Toolbox`_)\n- `Hunter`_ package management for cross platform builds: \"Organized Freedom!\" :)\n- Fast OpenGL ES 2.0 ACF Pyramid computation via `ogles_gpgpu`_\n- `OpenCV`_ API\n\n.. _OpenCV: https://github.com/opencv/opencv\n.. _ogles_gpgpu: https://github.com/hunter-packages/ogles_gpgpu\n.. _Hunter: https://github.com/ruslo/hunter\n.. _Fast Feature Pyramids for Object Detection: https://pdollar.github.io/files/papers/DollarPAMI14pyramids.pdf \n.. _Piotr's Matlab Toolbox: https://pdollar.github.io/toolbox for mobile friendly object detection\n\n.. |TravisCI| image:: https://img.shields.io/travis/elucideye/acf/master.svg?style=flat-square\u0026label=Linux%20OSX%20Android%20iOS\n  :target: https://travis-ci.org/elucideye/acf/builds\n\n.. |Appveyor| image:: https://img.shields.io/appveyor/ci/headupinclouds/acf.svg?style=flat-square\u0026label=Windows\n  :target: https://ci.appveyor.com/project/headupinclouds/acf\n\n.. |License| image:: https://img.shields.io/badge/license-BSD%203--Clause-brightgreen.svg?style=flat-square\n  :target: http://opensource.org/licenses/BSD-3-Clause\n  \n.. |Hunter| image:: https://img.shields.io/badge/hunter-v0.19.107-blue.svg\n  :target: http://github.com/ruslo/hunter\n\n===========\nQuick Start\n===========\n\nACF is a `CMake \u003chttps://github.com/kitware/CMake\u003e`__ based project\nthat uses the `Hunter \u003chttps://github.com/ruslo/hunter\u003e`__ package\nmanager to download and build project dependencies from source as\nneeded. Hunter contains `detailed\ndocumentation \u003chttps://docs.hunter.sh/en/latest\u003e`__, but a few high\nlevel notes and documentation links are provided here to help orient\nfirst time users. In practice, some working knowledge of CMake may also\nbe required. Hunter itself is written in CMake, and is installed as part\nof the build process from a single ``HunterGate()`` macro at the top of\nthe root ``CMakeLists.txt`` file (typically\n``cmake/Hunter/HunterGate.cmake``) (you don't have to build or install\nit). Each CMake dependency's ``find_package(FOO)`` call that is paired\nwith a ``hunter_add_package(FOO CONFIG REQUIRED)`` will be managed by\nHunter. In most cases, the only system requirement for building a Hunter\nproject is a recent `CMake with\nCURL \u003chttps://docs.hunter.sh/en/latest/contributing.html#reporting-bugs\u003e`__\nsupport and a working compiler correpsonding to the operative toolchain.\nHunter will maintain all dependencies in a\n`versioned \u003chttps://docs.hunter.sh/en/latest/overview/customization.html\u003e`__\nlocal\n`cache \u003chttps://docs.hunter.sh/en/latest/overview/shareable.html\u003e`__ by\ndefault (typically ``${HOME}/.hunter``) where they can be reused in\nsubsequent builds and shared between different projects. They can also\nbe stored in a server side `binary\ncache \u003chttps://docs.hunter.sh/en/latest/overview/binaries.html\u003e`__ --\nselect `toolchains \u003c#Toolchains\u003e`__ will be backed by a server side\nbinary cache (https://github.com/elucideye/hunter-cache) and will\nproduce faster first time builds (use them if you can!).\n\nThe\n`Travis \u003chttps://github.com/elucideye/drishti/blob/master/.travis.yml\u003e`__\n(Linux/OSX/iOS/Android) and\n`Appveyor \u003chttps://github.com/elucideye/drishti/blob/master/appveyor.yml\u003e`__\n(Windows) CI scripts in the project's root directory can serve as a\nreference for basic setup when building from source. To support cross\nplatform builds and testing, the CI scripts make use of\n`Polly \u003chttps://github.com/ruslo/polly\u003e`__: a set of common CMake\ntoolchains paired with a simple ``polly.py`` CMake build script. Polly\nis used here for convenience to generate ``CMake`` command line\ninvocations -- it is not required for building Hunter projects.\n\nTo reproduce the CI builds on a local host, the following setup is\nrecommended:\n\n-  Install compiler:\n   http://cgold.readthedocs.io/en/latest/first-step.html\n-  Install `CMake \u003chttps://github.com/kitware/CMake\u003e`__ (and add to\n   ``PATH``)\n-  Install Python (for Polly)\n-  Clone `Polly \u003chttps://github.com/ruslo/polly\u003e`__ and add\n   ``\u003cpolly\u003e/bin`` to ``PATH``\n\nNote: Polly is not a build requirement, CMake can always be used\ndirectly, but it is used here for convenience.\n\nThe ``bin/hunter_env.{sh,cmd}`` scripts (used in the CI builds) can be\nused as a fast shortcut to install these tools for you. You may want to\nadd the ``PATH`` variables permanently to your ``.bashrc`` file (or\nequivalent) for future sessions.\n\n+--------------------------------+--------------------------+\n| Linux/OSX/Android/iOS          | Windows                  |\n+================================+==========================+\n| ``source bin/hunter_env.sh``   | ``bin\\hunter_env.cmd``   |\n+--------------------------------+--------------------------+\n\nAfter the environment is configured, you can build for any supported\n``Polly`` toolchain (see ``polly.py --help``) with a command like this:\n\n::\n\n    polly.py --toolchain ${TOOLCHAIN} --config-all ${CONFIG} --install --verbose\n\n========\nTraining\n========\n\nTo train your own model, you can use Piotr's Toolbox.  This currently requires Matlab until the training code gets ported.  There are a few existing samples for pedestrian detection applications that are well documented and can be modified for your application.  See `acfDemoCal.m \u003chttps://github.com/pdollar/toolbox/blob/master/detector/acfDemoCal.m\u003e`__ for a sample training script.\n\n===========\nIntegration \n===========\n\nIf you would like to integrate the library in another project, the easiest thing will be to use `Hunter \u003chttp://github.com/ruslo/hunter\u003e`__ to manage and build your application or SDK.  The acf library and all dependencies will then be managed automatically.  Please see the documentation in the above link for more details.  If this isn't an option, it will be easiest to build ACF as a single shared library (without dependencies) that can then be integrated in your project.  In the later case, you can pass `ACF_BUILD_SHARED_SDK=ON` on the command line while generating the project in order to build the ACF library as a shared library such that all dependencies will be compiled as static libraries and \"absorbed\" by the acf library.  \n\n::\n\n    polly.py --toolchain ${TOOLCHAIN} --config-all ${CONFIG} --fwd ACF_BUILD_SHARED_SDK=ON --install --verbose\n\nFor iOS, you can use `polly` to create a dynamic framework from the generated `libacf.dylib` (see command line options) as a post build step, note the additional `--framework` and `--framework-lib` options in the build command below:\n\n::\n\n    polly.py --toolchain ${TOOLCHAIN} --config-all ${CONFIG} --fwd ACF_BUILD_SHARED_SDK=ON --install --verbose --framework --framework-lib libacf.dylib\n    \nThe resulting framework will be generated in the `_framework` directory as shown below:    \n   \n::\n\n    tree _framework/\n    _framework/\n    └── ios-11-3-dep-9-0-arm64\n        └── acf.framework\n            ├── Headers\n            │   ├── ACF.h\n            │   ├── ACFField.h\n            │   ├── GPUACF.h\n            │   ├── MatP.h\n            │   ├── ObjectDetector.h\n            │   ├── acf_common.h\n            │   └── acf_export.h\n            ├── Info.plist\n            ├── _CodeSignature\n            │   └── CodeResources\n            └── acf\n\n=====\nHOWTO\n=====\n\n::\n\n    _install/\n    └── libcxx\n        ├── bin\n        │   ├── acf-detect\n        │   └── acf-mat2cpb\n        ├── include\n        │   └── acf\n        │       ├── ACF.h\n        │       ├── ACFField.h\n        │       ├── GPUACF.h\n        │       ├── MatP.h\n        │       ├── ObjectDetector.h\n        │       ├── acf_common.h\n        │       └── acf_export.h\n        └── lib\n             ├── cmake\n             │   └── acf\n             │       ├── acfConfig.cmake\n             │       ├── acfConfigVersion.cmake\n             │       ├── acfTargets-release.cmake\n             │       └── acfTargets.cmake\n             └── libacf.a\n             \n.. code-block:: bash\n\n   $ cd _install/${TOOLCHAIN}/bin\n   $ wget https://github.com/elucideye/drishti-assets/raw/master/drishti_face_gray_80x80.cpb\n   $ wget https://github.com/elucideye/drishti-faces/raw/master/lena512color.png\n   $ ./acf-detect --input=lena512color.png --output=/tmp/ --model=drishti_face_gray_80x80.cpb --nms --annotate --calibration=0.00001\n   \n:: \n\n    [16:56:34.092 | thread:8703967691101883897 | acf-detect | info]: 1/1 /Users/dhirvonen/devel/elucideye//drishti-faces/lena512color.png = 1; score = 26.0038\n    \n============\nContributors\n============\n\nThis C++/OpenGL adaptation of the original ACF/toolbox project has benefited from contributions by:\n\n* Ruslan Baratov @ruslo: Numerous CMake and CI contributions, and of course, `Hunter \u003chttp://github.com/ruslo/hunter\u003e`__\n* @JN-Jones: Several fixes where the C++ didn't match the matlab reference: `#67 \u003chttps://github.com/elucideye/acf/issues/67\u003e`__,  `#62 \u003chttps://github.com/elucideye/acf/issues/62\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felucideye%2Facf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felucideye%2Facf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felucideye%2Facf/lists"}