{"id":27940560,"url":"https://github.com/khronosgroup/openvx-sample-impl","last_synced_at":"2025-05-07T10:18:16.814Z","repository":{"id":45229110,"uuid":"157795699","full_name":"KhronosGroup/OpenVX-sample-impl","owner":"KhronosGroup","description":"OpenVX sample implementation","archived":false,"fork":false,"pushed_at":"2024-02-17T21:52:39.000Z","size":2638,"stargazers_count":142,"open_issues_count":25,"forks_count":50,"subscribers_count":13,"default_branch":"openvx_1.3","last_synced_at":"2025-05-07T10:18:08.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhronosGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-11-16T01:33:06.000Z","updated_at":"2025-04-27T08:08:18.000Z","dependencies_parsed_at":"2024-10-27T18:26:00.438Z","dependency_job_id":null,"html_url":"https://github.com/KhronosGroup/OpenVX-sample-impl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenVX-sample-impl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenVX-sample-impl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenVX-sample-impl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenVX-sample-impl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/OpenVX-sample-impl/tar.gz/refs/heads/openvx_1.3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856568,"owners_count":21814858,"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":[],"created_at":"2025-05-07T10:18:16.202Z","updated_at":"2025-05-07T10:18:16.795Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build Status](https://travis-ci.com/KhronosGroup/OpenVX-sample-impl.svg?branch=openvx_1.2)](https://travis-ci.com/KhronosGroup/OpenVX-sample-impl)\n[![codecov](https://codecov.io/gh/KhronosGroup/OpenVX-sample-impl/branch/openvx_1.3/graph/badge.svg)](https://codecov.io/gh/KhronosGroup/OpenVX-sample-impl)\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"30%\" src=\"https://raw.githubusercontent.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/master/docs/data/OpenVX_logo.png\" /\u003e\u003c/p\u003e\n\n# OpenVX 1.3 Sample Implementation\n\n\u003ca href=\"https://www.khronos.org/openvx/\" target=\"_blank\"\u003eKhronos OpenVX™\u003c/a\u003e is an open, royalty-free standard for cross platform acceleration of computer vision applications. OpenVX enables performance and power-optimized computer vision processing, especially important in embedded and real-time use cases such as face, body and gesture tracking, smart video surveillance, advanced driver assistance systems (ADAS), object and scene reconstruction, augmented reality, visual inspection, robotics and more.\n\nThis document outlines the purpose of this sample implementation as well as provide build and execution instructions.\n\n## CONTENTS:\n\n* [Purpose](#purpose)\n* [Building And Executing](#building-and-executing)\n  * [CMake](#cmake)\n  * [Concerto](#concerto)\n* [Sample Build Instructions](#sample-build-instructions)\n* [Included Unit Tests](#included-unit-tests)\n* [Debugging](#debugging)\n* [Packaging And Installing](#packaging-and-installing)\n* [Bug Reporting](#bug-reporting)\n\n## Purpose\n\nThe purpose of this software package is to provide a sample implementation of the OpenVX 1.3 Specification that passes the conformance test. It is NOT intended to be a reference implementation.  If there are any discrepancies with the OpenVX 1.3 specification, they are not intentional and the specification should take precedence.  Many of the design decisions made in this sample implementation were motivated out of convenience rather than optimizing for performance.  It is expected that vendor's implementations would choose to make different design choices based on their priorities, and the specification was written in such a way as to allow freedom to do so. Beyond the conformance tests, there was very limited testing, as this was not intended to be directly used as production software.\n\nThis sample implementation contains additional 'experimental' or 'internally proposed' features which are not included in OpenVX 1.3.  Since these are not part of OpenVX, these are disabled by default in the build by using preprocessor definitions.  These features may potentially be modified or may never be added to the OpenVX spec, and should not be relied on as such. Additional details on these preprocessor definitions can be found in the BUILD_DEFINES document in this same folder.\n\nFuture revisions of the OpenVX sample implementation may or may not be released, and Khronos is not actively maintaining a public open source sample implementation project.\n\nThe following is a summary of what this sample implementation IS and IS NOT:\n\n**IS**:\n* passing OpenVX 1.3 conformance tests\n\n**IS NOT**:\n* a reference implementation\n* optimized\n* production ready\n* actively maintained by Khronos publically\n\n## Building And Executing\n\nThe sample implementation contains two different build system options:\ncmake and concerto (non-standard makefile-based system). The build and execution instructions for each are shown below.\n\n### CMake\n\n#### Supported systems:\n\n* Linux\n* Android\n* Windows (Visual studio or Cygwin)\n\n#### Pre-requisite:\n\n* python 2.x (Tested with python 2.7)\n* CMAKE 2.8.12 or higher. (should be in PATH)\n\n##### Windows:\n* Visual studio 12 (2013) or higher in order to create VS solution and use VS compiler to build OpenVX and related projects. (Need DEVENV in PATH) Or Cygwin.\n\n##### Android:\n* NDK tool chain.\n\n#### Building:\n\n    Windows:\n    --------\n    From VS / Cygwin command prompt:\n\n    \u003e python Build.py --help\n\t\n    In case of Visual Studio solution, the default CMAKE_GENERATOR is \"Visual Studio 12\", you can change it with --gen option. (cmake --help present the supported generators)\n\n    Linux:\n    ------\n    From shell:\n\n    \u003e python Build.py --help\n\n    The command above will present the available build options, please follow these options.\n\n    VS solution will create in:\n    ---------------------------\n    ${OUTPUT_PATH}/build/${OS}/${ARCH}/OpenVX.sln\n\n    In order to build and install all the sample projects from VS, build the 'INSTALL' project. (Build.py trigger it by default)\n\n    Make files will create in:\n    --------------------------\n    ${OUTPUT_PATH}/build/${OS}/${ARCH}/${CONF}\n\n    In order to build and install all the sample projects, call to 'make install'. (Build.py trigger it by default)\n\n    OUTPUT_PATH - The path to output, default the root directory.\n    OS - Win / Linux / Android. (Cygwin is equal to Linux)\n    ARCH - 32 / 64\n    CONF - Release / Debug.\n\t\n    Enable / Disable experimental options (Optional):\n    -------------------------------------------------\n\tWindows:\n\t--------\n        (1) Run the python script, set --build=false\n        (2) Open cmake GUI\n            (2.1) Set the source code directory to the openvx root folder, where the root CMakeLists.txt is located\n            (2.2) Set the build directory to ${OUTPUT_PATH}/build/${OS}/${ARCH}\n        (3) Select the options to enable / disable\n        (4) Click the 'Configure' button in order to update the \"CMakeCache.txt\" file (Do not click on 'Generate' button)\n        (5) Re-run the python script. (You can set --build=true or build from Visual Studio)\n\t\t\n        Linux:\n        ------\n        (1) Run the python script, set --build=false\n        (2) Navigate to ${OUTPUT_PATH}/build/${OS}/${ARCH}/${CONF}\n        (3) \u003e make edit_cache\n        (4) Select the options to enable / disable\n        (5) click 'c' to configure\n        (6) click 'g' to generate the make files\n        (7) \u003e make install\n\n#### Install:\n\n    The build process installs the OpenVX headers in 'include' folder / executables and libraries in 'bin' folder / libs in 'lib' folder under:\n    ${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}\n\n##### Running:\n\n    Windows:\n    --------\n    Add ${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin to PATH\n\n    Linux:\n    ------\n    Set LD_LIBRARY_PATH ${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin\n\n    $ cd raw\n    $ ${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin/vx_test\n\n### Concerto\n\nThe following systems are supported by the concerto build:\n* Linux (GCC or CLANG)\n* Darwin/Mac OSX\n* Windows NT (Cygwin or native Visual Studio 2013)\n\nFor each system, consider the following prerequisites:\n\n    1. Linux\n    --------\n    gcc is the default compiler.  If clang is desired, then it can be chosen\n    by setting the HOST_COMPILER environment variable to CLANG.\n\n    If using gcc, version 4.3.0 or above should be used.\n\n    2. Darwin/OSX\n    -------------\n    Mac OSX Users need to use either MacPorts or Fink (or other favorite\n    package manager) to install the same set of packages above.\n\n    3. Windows NT (Cygwin or native)\n    -----------------------------\n\n    (Cygwin)\n    --------\n    It is recommended that Windows users install Cygwin to build OpenVX.\n    Obtain and run the setup utility at:\n\n        http://cygwin.com/setup.exe\n\n    In addition to the defaults, you MUST manually select the gcc-core,\n    make, and gcc-g++ packages in the cygwin setup utility.  All are in\n    the \"Devel\" category. gcc version 4.3.0 or above should be used.\n\n    (native MS Visual Studio 2013)\n    --------\n    Required packages to build:\n        - Microsoft Visual Studio 2013 (at least)\n        - A make utility compiled for windows (examples):\n          - mingw32-make.exe (http://www.mingw.org)\n          - gmake from XDCTools (http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/)\n\n    For building the code, adding the path to \"make.exe\" to\n    the PATH is required after the \"vcvarsall.bat\" batch file (which\n    configures the environment for compiling with VC) is executed from a\n    CMD window.\n\n#### Building OpenVX using Concerto\n\nOnce the correct packages above are installed, the sample implementation can be built by typing \"make\" in the OpenVX installation directory (e.g., \"openvx_sample\").\n\n    $ cd openvx_sample\n    $ make\n\nOutputs are placed in \n\n    out/$(TARGET_OS)/$(TARGET_CPU)/$(TARGET_BUILD)/\n    \nThese variables are visible in the make output. This will be referred to as TARGET_OUT, though this may not be present in the actual environment (users could define this themselves).\n\nIn order to see a list and description of all make commands for concerto,\ntype:\n\n    $ make help\n\n\n#### Executing OpenVX using Concerto\n\nThe tests can be manually run as follows. In any environment, PATHs may need to be altered to allow loading dynamic modules. The $(TARGET_OUT) variable below should be replaced with the actual path to the output file where the libraries and executables are placed, as per the description in section 1: BUILD.\n\n##### On Linux\n\nTARGET_OUT is usually out/LINUX/x86_64/release\n\n    $ cd raw\n    $ LD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_test\n\n##### On Windows (Cygwin)\n\nTARGET_OUT is usually\n\n    out/CYGWIN/X86/release\n\nCommands:\n\n    $ cd raw\n    $ LD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_test\n\n##### On Windows (native)\n\nTARGET_OUT is usually\n\n    out\\Windows_NT\\x86\\release\n\nCommands:\n\n    C:\\\u003e copy raw\\*.* %TARGET_OUT%\n    C:\\\u003e pushd %TARGET_OUT% \u0026\u0026 vx_test.exe\n\n##### On Mac OSX (from openvx_sample)\n\nTARGET_OUT is usually\n\n    out/DARWIN/x86_64/release\n\nCommands:\n\n    $ cd raw\n    $ DYLD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_test\n\n## Sample Build Instructions\n\n### Sample 1 - Build OpenVX 1.3 on Ubuntu 18.04\n\n* Git Clone project with recursive flag to get submodules\n````\ngit clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git\n````\n* Use `Build.py` script\n````\ncd OpenVX-sample-impl/\npython Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn\n````\n* Build and run conformance\n````\nexport OPENVX_DIR=$(pwd)/install/Linux/x64/Debug\nexport VX_TEST_DATA_PATH=$(pwd)/cts/test_data/\nmkdir build-cts\ncd build-cts\ncmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\\;$OPENVX_DIR/bin/libvxu.so\\;pthread\\;dl\\;m\\;rt -DOPENVX_CONFORMANCE_VISION=ON -DOPENVX_USE_ENHANCED_VISION=ON -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/\ncmake --build .\nLD_LIBRARY_PATH=./lib ./bin/vx_test_conformance\n````\n\n### Sample 2 - Build OpenVX 1.3 on Raspberry Pi\n\n* Git Clone project with recursive flag to get submodules\n````\ngit clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git\n````\n* Use `Build.py` script\n````\ncd OpenVX-sample-impl/\npython Build.py --os=Linux --venum --conf=Debug --conf_vision --enh_vision --conf_nn\n````\n* Build and run conformance\n````\nexport OPENVX_DIR=$(pwd)/install/Linux/x32/Debug\nexport VX_TEST_DATA_PATH=$(pwd)/cts/test_data/\nmkdir build-cts\ncd build-cts\ncmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\\;$OPENVX_DIR/bin/libvxu.so\\;pthread\\;dl\\;m\\;rt -DOPENVX_CONFORMANCE_VISION=ON -DOPENVX_USE_ENHANCED_VISION=ON -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/\ncmake --build .\nLD_LIBRARY_PATH=./lib ./bin/vx_test_conformance\n````\n\n## Included Unit Tests\n\nThe sample implementation comes with a few unit sanity tests that exercises\nsome examples of the specification.  The executables are called:\n\n**vx_test:**\n* main function is in source file: openvx_sample/tests/vx_test.c\n* No arguments will run all included unit tests.\n* Argument will list the tests to be run\n* Single tests can be run by specifying test number using -t \u003ctestnum\u003e\n* Expects to be run from the raw directory (the program looks for image files in the execution directory).\n\n**vx_query:**\n* Main function is in source file: openvx_sample/tools/query/vx_query.c\n* Queries the implementation and prints out details about all kernels\n\n**vx_example:**\n* Main function is in source file: openvx_sample/examples/vx_graph_factory.c\n* This is an example of creating and running a graph using what is called a graph factory.  This example is beyond the scope of the openvx specification, but is an example of how graph parameters can be use to abstract the details of a graph to clients.\n\nvx_bug13510:\nvx_bug13517:\nvx_bug13518:\n    - Exercise code exposing fixed bugs.\n\n## Debugging\n\nTo build in debug mode (this will output in the out/.../debug folder rather\nthan out/.../release, thus if you defined TARGET_OUT, you'll have to change it. \n\n    $ export NO_OPTIMIZE=1\n    $ make\n\nor \n\n    $ make TARGET_BUILD=debug\n\nTo enable traces (printfs/logs/etc), use either the mask (higher priority) or\nlist of zones to enable. In the mask, the zones are the bit places. Express the\nmask as a hex number.\n\n    $ export VX_ZONE_MASK=0x\u003chexnumber\u003e\n    \nor use the list as a comma delimited set of zone numbers (see 'sample/include/vx_debug.h')\n\n    $ export VX_ZONE_LIST=0,1,2,3,6,9,14\n\nThe list of mapping zones to bits can be found in openvx_sample/debug/vx_debug.h\n\nIf you want these variable as part of the command line:\n\n    $ unset VX_ZONE_MASK\n    $ unset VX_ZONE_LIST\n    $ make\n    $ cd raw\n    $ VX_ZONE_LIST=0,3,16 vx_test \u003coptions\u003e\n\nNote: VX_ZONE_MASK will override VX_ZONE_LIST. So if you have both set, only\nVX_ZONE_MASK is being seen by the implementation. \n\nNow run your tests again.\n\n\n## Packaging And Installing\n\nOn Linux, the sample implementation for OpenVX is packaged after a make in\n\n    out/LINUX/x86_64/openvx-*.deb\n\nInstalling DEB package\n\n    $ dpkg-deb -i \u003cpath\u003e/openvx-*.deb\n\n\n## Bug Reporting\n\nAlthough Khronos is not actively maintaining a public project of this sample implementation, bug reports can be reported back to the working group in an effort to make sure that we don't overlook related specification and implementation issues going forward.\n\nIf any bugs are found in the sample implementation, you can notify the Khronos working group via \n* File an [issue on the GitHub](https://github.com/KhronosGroup/OpenVX-sample-impl/issues)\n* The OpenVX feedback forum: https://community.khronos.org/c/openvx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopenvx-sample-impl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fopenvx-sample-impl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopenvx-sample-impl/lists"}