TIOVX User Guide
vx_tutorial_graph_image_gradients_pytiovx_uc.py File Reference

This file show example of using basic PyTIOVX APIs to describe an OpenVX graph. More...

Go to the source code of this file.

Functions

def vx_tutorial_graph_image_gradients_pytiovx_uc.make_my_graph ()
 Function to describe a graph and generate code, image using PyTIOVX tool.
 

Detailed Description

This file show example of using basic PyTIOVX APIs to describe an OpenVX graph.

To import PyTIOVX module so that the APIs can be called in this file add below line

from tiovx import *

The basic steps one follows to describe the graph for PyTIOVX tool are,

  • Create a context object.
    • Pass as input a string which is used as a perfix to name the generated code and function.
  • Create a graph object object
  • Create data objects.
    • TIP: specify a name for data objects via name="xyz" to be able to identify it in the generated C code and image file
  • Create node objects and link it to required data objects
    • TIP: Add nodes to graph as you create them using graph.add()
    • TIP: Use target=Target.<TargetName> to specify the target on which this node runs.
  • Add graph to context using context.add()
  • Generate C code for the objects in a context using
    ExportCode(context).export()
  • Generate image file for the objects in a context using
    ExportImage(context).export()
  • Run the PyTIOVX on this file using
    python <.py file>
  • In case of any error reported by the PYTIOVX tool, correct the input .py file
  • Verify the generated image file to confirm the graph is as expected.
  • Write the remaining C code to invoke the generated APIs

See source code of function vx_tutorial_graph_image_gradients_pytiovx_uc.make_my_graph() for detailed API usage for this example.

Definition in file vx_tutorial_graph_image_gradients_pytiovx_uc.py.