Sample scripts
The Sentis package comes with a set of sample scripts that show working examples of using the API.
To find the sample scripts:
- Go to Windows > Package Manager, and select Sentis from the package list.
- Select Samples.
- To import a sample folder into your Project, select Import. Unity creates a
Samples
folder in your Project, and imports the sample folder you selected.
Sample folder | Description |
---|---|
Add a custom layer | An example of adding a custom layer to implement a custom ONNX operator. |
Check the metadata of a model | An example of checking the metadata of a model. |
Convert tensors to textures | Examples of converting tensors to textures. Refer to Use output data for more information. |
Convert textures to tensors | Examples of converting textures to textures. Refer to Create input for a model for more information. |
Copy a texture tensor to the screen | An example of using TextureConverter.RenderToScreen to copy a texture tensor to the screen. Refer to Use output data for more information. |
Do an operation on a tensor | An example of using IOps to do an operation on a tensor. Refer to Do operations on tensors for more information. |
Read output asynchronously | Examples of reading the output from a model asynchronously, using compute shaders or Burst. Refer to Read output from a model asynchronously for more information. |
Run a model a layer at a time | An example of using StartManualSchedule to run a model a layer a time. Refer to Run a model for more information. |
Run a model | Examples of running models with different numbers of inputs and outputs. Refer to Run a model for more information. |
Use a compute buffer | An example of using a compute shader to write data to a tensor on the GPU. |
Use Burst to write data | An example of using Burst to write data to a tensor in the Job system. |
Use tensor indexing methods | Examples of using tensor indexing methods to get and set tensor values. |