Git Product home page Git Product logo

khronosgroup / openvx-samples Goto Github PK

View Code? Open in Web Editor NEW
101.0 12.0 27.0 5.13 MB

OpenVX Samples to use with any conformant implementation of OpenVX

License: MIT License

CMake 7.65% C++ 86.88% C 5.48%
openvx opencv openvx-sample canny-edge-detection canny canny-live computer-vision open-source open-standard api royalty-free cross-platform openvx-samples openvx-conformant skin-tone-detect bubble-pop skin-tone-sample openvx-graph khronos-openvx khronosgroup

openvx-samples's Introduction

MIT licensed

OpenVX Samples

Khronos OpenVX™ 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.

In this project, we provide OpenVX sample applications to use with any conformant implementation of OpenVX.

VX Bubble Pop Sample

In this sample we will create an OpenVX graph to run VX Bubble Pop on a live camera. This sample application uses OpenCV to decode input image, draw bubbles/donuts and display the output.

Prerequisites

Steps to run the Bubble Pop sample

Build OpenVX on Linux

* Git Clone project with a recursive flag to get submodules

      git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git

* Use Build.py script

      cd OpenVX-sample-impl/
      python Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn
  • Step - 2: Export OpenVX Directory Path
export OPENVX_DIR=$(pwd)/install/Linux/x64/Debug
  • Step - 3: Clone the OpenVX Samples project and build the bubble pop application
cd ~/ && mkdir OpenVXSample-pop
cd OpenVXSample-pop/
git clone https://github.com/kiritigowda/openvx-samples.git
  • Step - 4: CMake and Build the pop application
mkdir pop-build && cd pop-build
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so ../openvx-samples/bubble-pop/
make
  • Step - 5: Run VX Pop application

    • Bubbles
    ./vxPop --bubble
    
    • Donuts
    ./vxPop --donut
    

Canny Edge Detector Sample

In this sample we will create an OpenVX graph to run canny edge detection on an image or a live camera. This sample application uses OpenCV to decode input image and display the output.

Prerequisites

Steps to run the canny sample

Build OpenVX on Linux

* Git Clone project with a recursive flag to get submodules

      git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git

* Use Build.py script

      cd OpenVX-sample-impl/
      python Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn
  • Step - 2: Export OpenVX Directory Path
export OPENVX_DIR=$(pwd)/install/Linux/x64/Debug
  • Step - 3: Clone the OpenVX Samples project and build the canny application
cd ~/ && mkdir OpenVXSample-canny
cd OpenVXSample-canny/
git clone https://github.com/kiritigowda/openvx-samples.git
  • Step - 4: CMake and Build the canny application
mkdir canny-build && cd canny-build
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so ../openvx-samples/canny-edge-detector/
make
  • Step - 5: Run Canny application

    • Live
    ./cannyEdgeDetector --live
    
    • Image
    ./cannyEdgeDetector --image ../openvx-samples/images/face.png
    

Skin Tone Detector Sample

In this sample we will create an OpenVX graph to run skintone detection on an image or a live camera. This sample application uses OpenCV to decode input image and display the output.

Prerequisites

Steps to run the skin tone sample

Build OpenVX on Linux

* Git Clone project with a recursive flag to get submodules

      git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git

* Use Build.py script

      cd OpenVX-sample-impl/
      python Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn
  • Step - 2: Export OpenVX Directory Path
export OPENVX_DIR=$(pwd)/install/Linux/x64/Debug
  • Step - 3: Clone the OpenVX Samples project and build the Skin Tone application
cd ~/ && mkdir OpenVXSample-skintone
cd OpenVXSample-skintone/
git clone https://github.com/kiritigowda/openvx-samples.git
  • Step - 4: CMake and Build the Skin Tone application
mkdir skintone-build && cd skintone-build
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so ../openvx-samples/skin-tone-detector/
make
  • Step - 5: Run Skin Tone Detector application

    • Live
    ./skinToneDetector --live
    
    • Image
    ./skinToneDetector --image ../openvx-samples/images/face.png
    

Contribution

The samples VX Bubble Pop, VX Canny Edge Detector, & VX Skin Tone Detector are contributed by AMD from their MIVisionX Toolkit. We welcome contributions to this project from all developers. Please open a pull request with details of your sample application to be accepted into this project.

openvx-samples's People

Contributors

hopetech avatar jwinarske avatar kiritigowda avatar patha454 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvx-samples's Issues

Non-compliance with the standard

There are no initializations of dim_x and dim_y in:

But the standard says (https://registry.khronos.org/OpenVX/specs/1.3.1/html/OpenVX_Specification_1_3_1.html#:~:text=%5Bin%5D%20user_addr,REQ-0928%5D):

In the structure, only dim_x, dim_y, stride_x and stride_y fields must be provided, other fields are ignored by the function [REQ-0927]

This requirement is in all standards.

Please post OpenVX feedback here

The OpenVX working group would like to ask the community for feedback and contributions to make OpenVX more accessible to developers. If you have any requests or suggestions on topics to cover or resources to be developed, please ask them here. If you have a resource to suggest please add an issue or pull request here. We look forward to hearing from you!

The OpenVX Working Group

Please rename default branch from 'master' to 'main' per Khronos policy

To repository owners: please rename the default branch of this repository from 'master' to 'main', using the Github renaming tool. This request is per policy set by the Khronos Promoters in May 2021, to follow Github community practice for respectful naming.

The Github renaming tool sets up URL redirections and retargets outstanding pull requests, so the impact on repository users is minimal. The most visible issue is that people with local repo clones will probably want to rename their clone's 'master' branch, following the popup instructions that will be seen when browsing the github repository after the change; or just delete 'master' and pull the new 'main', if it's purely a tracker with no local content.

You may wish to coordinate with @outofcontrol if you are doing auto-updates from this repository to another location, whether via push/pull mirroring or other mechanisms. The redirects setup by Github should accommodate most such uses transparently, but it's still good practice.

Based on experience with other KhronosGroup repositories which have undergone this renaming already, this is a reasonable approach:

  • Agree on a date for the renaming within the Working Group or other owners of the repository, and document that date here.
    • Date can be adjusted to avoid interaction with major releases in flight.
  • Provide notice to repository users outside Khronos, insofar as possible (adding a comment in the repo README with the switchover date is one way).
  • Once the renaming is done, edit the new 'main' branch to replace hardwired references to 'master' with (preferably) 'default branch' or 'main'.
  • Update the repo README to note the change.

If you have questions or issues about this, please raise them on Khronos internal gitlab 'khronos-general' issue 106 if possible. If not possible, you can @-tag me here.

While we will not force any WG into acting precipitously, this is our agreed policy. Please try to accommodate renaming relatively soon.

Note that this issue is automatically generated, due to the large number of KhronosGroup repositories it's being raised in.

Failed to run all application

I used OpenCV 3.4.3 to run all applications and show the messages as below.
Can anybody help me? Thanks

./bubble-pop/vxPop --donut
vxPublishKernels
No target named khronos.any exists!
ERROR: failed with status = (-1) at /OpenVX-sample-impl/openvx-samples/bubble-pop/source/AMD_app.cpp#54
./canny-edge-detector/cannyEdgeDetector  --image ../openvx-samples/images/face.png
Kernel enum 1 not found.
Kernel 0x559d9d8e70 was invalid!
Failed to create node with kernel enum 1
Kernel enum 2 not found.
Kernel 0x559d9d8e70 was invalid!
Failed to create node with kernel enum 2
Kernel enum 1b not found.
Kernel 0x559d9d8e70 was invalid!
Failed to create node with kernel enum 27
ERROR: failed with status = (-12) at /OpenVX-sample-impl/openvx-samples/canny-edge-detector/src/canny.cpp#80
./skin-tone-detector/skinToneDetector --image ../openvx-samples/images/face.png
Kernel enum 2 not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 2
Kernel enum 2 not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 2
Kernel enum 2 not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 2
Kernel enum 22 not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 34
Kernel enum 22 not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 34
Kernel enum d not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 13
Kernel enum d not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 13
Kernel enum d not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 13
Kernel enum d not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 13
Kernel enum d not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 13
Kernel enum 1c not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 28
Kernel enum 1c not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 28
Kernel enum 1c not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 28
Kernel enum 1c not found.
Kernel 0x556d676e70 was invalid!
Failed to create node with kernel enum 28
ERROR: failed with status = (-12) at /OpenVX-sample-impl/openvx-samples/skin-tone-detector/src/skinToneDetector.cpp#136

Unable to run pop application

While running ./vxPop --donut, getting following error

(VX POP - LIVE:3328): GLib-GObject-CRITICAL **: 15:46:45.249: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

fatal error: VX/vx.h: No such file or directory compilation terminated.

~/OpenVXSample-pop/pop-build$ make
Scanning dependencies of target vx_pop
[ 12%] Building CXX object CMakeFiles/vx_pop.dir/source/AMD_VX_Pop_Bubble.cpp.o
In file included from /home/devuser/OpenVXSample-pop/openvx-samples/bubble-pop/include/vx_pop.h:26:0,
from /home/devuser/OpenVXSample-pop/openvx-samples/bubble-pop/include/internal_opencvTunnel.h:30,
from /home/devuser/OpenVXSample-pop/openvx-samples/bubble-pop/include/internal_publishKernels.h:31,
from /home/devuser/OpenVXSample-pop/openvx-samples/bubble-pop/source/AMD_VX_Pop_Bubble.cpp:23:
/home/devuser/OpenVXSample-pop/openvx-samples/bubble-pop/include/vx_ext_pop.h:22:19: fatal error: VX/vx.h: No such file or directory
compilation terminated.
CMakeFiles/vx_pop.dir/build.make:62: recipe for target 'CMakeFiles/vx_pop.dir/source/AMD_VX_Pop_Bubble.cpp.o' failed
make[2]: *** [CMakeFiles/vx_pop.dir/source/AMD_VX_Pop_Bubble.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/vx_pop.dir/all' failed
make[1]: *** [CMakeFiles/vx_pop.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

I get this error when building this.

No function implementation vxUnpublishKernels

ERROR: failed with status = (-7)

ERROR: failed with status = (-7) at /home/pi/OpenVXSample-pop/openvx-samples/bubble-pop/source/AMD_app.cpp#50

What is this error??

Unable to run application

While running the canny edge application in live mode, i'm getting this error

Failed to remove kernel[0]=org.khronos.extra.edge_trace
Failed to remove kernel[1]=org.khronos.extra.euclidean_nonmaxsuppression_harris
Failed to remove kernel[2]=org.khronos.extras.harris_score
Failed to remove kernel[3]=org.khronos.extras.laplacian3x3
Failed to remove kernel[4]=org.khronos.extras.image_to_list
Failed to remove kernel[5]=org.khronos.extra.nonmaximasuppression
Failed to remove kernel[6]=org.khronos.extra.elementwise_norm
Failed to remove kernel[7]=org.khronos.extras.scharr3x3
Failed to remove kernel[8]=org.khronos.extras.sobelMxN

AMD E9171 GPU OPENVX USAGE

Hi, is ti possible to use openvx with amd e9171 gpu ? If can not, do you know, how can use nnef or onnx file with this gpu ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.