Pipeline
SpatialML pipeline.
Each pipeline defines a computation graph of tensors. A pipeline will not be run until it is submitted, and each submission will schedule one execution of the whole pipeline. One submitted execution will be put onto one thread in the backend, so that multiple submitted pipelines can be run concurrently.
Throws
If the usage is not allowed by the SpatialML run-time Framework, or if the framework encounters internal error and cannot perform the requested behavior.
Types
Color conversion types.
Defining the relationship between a Tensor, and undefined JS val in the JavaScript script to be executed by Pipeline.runJavaScript.
Model inference type, determining what inference engine the algorithm model will be run on, and what hardware backend will be used to accelerate the model inference.
The association of a node in a model (QNN, TFLite, etc.) computation graph and a pipeline tensor.
Normalization type for normalize.
Norm type for norm.
The handle to one submitted pipeline run task.
Enum to determine how a matrix will be sorted.
Horizontal alignment that can be used to update SceneGraphProperty.Text.HorizontalAlignment.
Vertical alignment that can be used to update SceneGraphProperty.Text.VerticalAlignment.
Properties
The BaseHandle's implementation's destructor.
A helper getter to create a new local tensor in-place for an android android.graphics.Color. The R, G, B, and A values of the provided color will be set as the tensor's content automatically.
A helper getter to create a new local tensor in-place for a android android.graphics.Point. The X and Y values of the provided point will be set as the tensor's content automatically.
A helper getter to create a new local tensor in-place for an array of android.graphics.Color. The R, G, B, and A values of the provided colors will be set as the tensor's content automatically.
A helper getter to create a new local tensor in-place for an array of android android.graphics.Point. The X and Y values of the provided points will be set as the tensor's content automatically.
A helper getter to create a new local tensor in-place for a single byte scalar.
A helper getter to create a new local tensor in-place for a single double scalar.
A helper getter to create a new local tensor in-place for double array
A helper getter to create a new local tensor in-place for a single float scalar.
A helper getter to create a new local tensor in-place for a float array.
A helper getter to create a new local tensor in-place for a single int scalar.
A helper getter to create a new local tensor in-place for an int array.
A helper getter to create a new local tensor in-place for a single short scalar.
A helper getter to create a new local tensor in-place for a short array.
A helper getter to create a new local tensor in-place for a string.
Functions
Apply the affine transform on 2D image.
Apply the affine transform on 2D points rather than 2D images.
Defines an arithmetic operator to the pipeline. The operator allows you to define complex operations between tensors. Different from the above overload which is defined by a string expression, this overload allows you to define the arithmetic operations directly, hence providing operand validations and type checks.
Defines an arithmetic operator to the pipeline. An arithmetic operator takes in an array of PipelineTensor (size of which must be no more than 10), and write the arithmetic result into result. The arithmetic expression to be executed is defined by expression.
Perform an bitwise-and of two input tensors.
Perform a byte-wise all on all the values constituting the tensor.
Perform a byte-wise any on all the values constituting the tensor.
Captures microphone stereo-audio track into tensors, encoded in compatible PCM format.
Captures microphone left and right audio track into separated tensors, encoded in compatible PCM format. Note: at least one of the leftTrackResult and the rightTrackResult must be present.
Convert the color, e.g. RGB-to-Grayscale, RGB-to-BGR, etc.
Copy from a slice of one pipeline tensor to a slice of another tensor. The slice of the copy source must contain the same number of values as the total number of values in the copy destination.
Copy from one slice of a pipeline tensor to another. The slice of the copy source must contain the same number of values as the total number of values in the copy destination.
Copy from one pipeline tensor to a slice of another tensor. The slice of the copy source must contain the same number of values as the total number of values in the copy destination.
Perform an elementwise-max of two input tensors.
Perform an elementwise-min of two input tensors.
Perform an elementwise-multiplication of two input tensors.
Convenient method to directly create a slice of a GlobalTensor using bracket operators from a tensor. This operator overload allows SpatialML framework users to apply tensors output from previous steps as a dynamic slices.
Convenient method to directly create a slice of a GlobalTensor using bracket operators from IntProgression. Different from the overloaded method that uses IntRange as inputs, IntProgression allows skip and backward iteration. Similarly, there must be the same number of IntProgression inputs as the number of this tensor's dimensions
Convenient method to directly create a slice of a GlobalTensor using bracket operators from IntRanges like 0..5, 1..2.
Create a slice on channels using bracket operators from a slice tensor.
Define a relationship between a Tensor and a JS var in the JavaScript script to be executed by Pipeline.runJavaScript that: will copy the tensor's content into the JavaScript var name during execution of JavaScript, but the update of the JavaScript var name will not be written back to the tensor.
Define a relationship between a Tensor and a JS var in the JavaScript script to be executed by Pipeline.runJavaScript that: will copy the tensor's content into the JavaScript var name during execution of JavaScript, and the update of the JavaScript var name will be written back to the tensor after the execution of JavaScript.
Perform an elementwise-large-equal comparison of two input tensors.
Perform an elementwise-large-than comparison of two input tensors.
Compute the 4x4 transform matrix for translation, rotation and scale.
A helper function to create a new local tensor in-place for an android android.graphics.Color. The R, G, B, and A values of the provided color will be set as the tensor's content automatically.
A helper function to create a new local tensor in-place for a android android.graphics.Point. The X and Y values of the provided point will be set as the tensor's content automatically.
Create a new local tensor inside this pipeline. The tensor have memory allocated local to the pipeline.
A helper function to create a new local tensor in-place for an array of android.graphics.Color. The R, G, B, and A values of the provided colors will be set as the tensor's content automatically.
A helper function to create a new local tensor in-place for an array of android android.graphics.Point. The X and Y values of the provided points will be set as the tensor's content automatically.
A helper function to create a new local tensor in-place for a single character.
A helper function to create a new local tensor in-place for a single double scalar.
A helper function to create a new local tensor in-place for a double array.
A helper function to create a new local tensor in-place for a single float scalar.
A helper function to create a new local tensor in-place for a float array.
A helper function to create a new local tensor in-place for a single int scalar.
A helper function to create a new local tensor in-place for an int array.
A helper function to create a new local tensor in-place for a single short scalar.
A helper function to create a new local tensor in-place for a short array.
A helper function to create a new local tensor in-place for a string.
Create a new placeholder tensor inside this pipeline. Different from a local tensor, a placeholder tensor has no local memory allocated in the pipeline's scope; on the contrary, the placeholder must refer to a compatible global tensor when the pipeline is submitted for execution.
Create a new placeholder tensor inside this pipeline with guarantee compatibility with the a GlobalTensor, i.e., the newly created placeholder share the same configuration with the GlobalTensor. Note: a placeholder tensor has no local memory allocated in the pipeline's scope; on the contrary, the placeholder must refer to a compatible global tensor when the pipeline is submitted for execution.
Create an SpatialML scene from a glTF file already loaded into SharedMemory. Similar to SpatialMLSession.newSceneFromGLTF but that one creates a global scene graph handle, so that multiple pipelines can share, whereas this method creates one scene graph local to the pipeline only.
Compute the norm of a tensor.
Define a relationship between a Tensor and a JS var in the JavaScript script to be executed by Pipeline.runJavaScript that: will write the content of the specified JS var to the tensor after the JavaScript's execution is done. The JS var will be initialized as an all-zero JS array of the corresponding datatype, with length = the total count of elements in the Tensor.
Play sounds from an audio track. The audio track must be encoded in PCM format.
Obtain the latest camera images. The images will be rectified internal against len distortion.
Put a JS script into the SpatialML pipeline for execution.
Run the inference of an algorithm model provided in binary package.
Perform singular value decomposition of a matrix.
Perform an elementwise-smaller-equal comparison of two input tensors.
Perform an elementwise-smaller-than comparison of two input tensors.
Run the OpenCV solve PnP algorithm. Solve PnP reverses the camera projection procedure: given the projected result (2D points) of the vertices of a mesh, and the original 3D coordinates of the mesh vertices corresponding to the mesh's local space, inferring the most likely pose of the mesh corresponding to the camera space.
Sort a matrix, column-by-column or row-by-row.
Submit the pipeline for one run. Note: the method only submits the run as a task, and SpatialML framework will schedule the task based on its waitFor task, the GlobalTensor it will access, and the current computation resource availability.
Switch tensor content between a CHW and HWC format. A tensor of CHW format means it is a multi-dimensional tensor of datatype = Tensor.DataType, and 3 dimensions: CxHxW. A tensor of HWC format means it is a multi-dimensional tensor of 2 dimensions: HxW, with datatype = Tensor.DataType.Image.
Control the visibility of an already-loaded scene graph tensor.
Update data of a specified component property in the scene graph, using the values from a tensor.
Update data of text content of a text component in the scene graph using a text String.
Update data of horizontal alignment of a text component in the scene graph using the alignment enum defined in TextHorizontalAlignment.
Update data of vertical alignment of a text component in the scene graph using the alignment enum defined in TextVerticalAlignment.