docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ToTexture

    ToTexture(TensorFloat, int, int, int, bool)

    Converts the data in a tensor to a render texture. Sentis only writes batch == 0 to the render texture.

    If the width and height of the render texture don't match the width and height of the tensor, Sentis applies linear resampling.

    Declaration
    public static RenderTexture ToTexture(TensorFloat tensor, int width = -1, int height = -1, int channels = -1, bool broadcastChannels = false)
    Parameters
    Type Name Description
    TensorFloat tensor

    The input tensor.

    int width

    The width of the output render texture. If the value is -1, Sentis uses the tensor to infer the width.

    int height

    The height of the output render texture. If the value is -1, Sentis uses the tensor to infer the height.

    int channels

    The numbers of channels of the output render texture. If the value is -1, Sentis uses the tensor to infer the number of channels.

    bool broadcastChannels

    When the value is true, Sentis broadcasts the tensor values to additional channels in the render texture. For example, a tensor with a single channel R maps to (R, R, R, R) if channels is 4. When the value is false, Sentis applies a (0, 0, 0, 1) color mask to additional channels in the render texture. For example, a tensor with a single channel R becomes (R, 0, 0, 1) if channels is 4.

    Returns
    Type Description
    RenderTexture

    The created render texture.

    ToTexture(CommandBuffer, TensorFloat, int, int, int, bool)

    Appends the convertion of the data in a tensor to a render texture to a CommandBuffer. Sentis only writes batch == 0 to the render texture.

    If the width and height of the render texture don't match the width and height of the tensor, Sentis applies linear resampling.

    Declaration
    public static RenderTexture ToTexture(this CommandBuffer cb, TensorFloat tensor, int width = -1, int height = -1, int channels = -1, bool broadcastChannels = false)
    Parameters
    Type Name Description
    CommandBuffer cb

    The CommandBuffer buffer to append graphics command to.

    TensorFloat tensor

    The input tensor.

    int width

    The width of the output render texture. If the value is -1, Sentis uses the tensor to infer the width.

    int height

    The height of the output render texture. If the value is -1, Sentis uses the tensor to infer the height.

    int channels

    The numbers of channels of the output render texture. If the value is -1, Sentis uses the tensor to infer the number of channels.

    bool broadcastChannels

    When the value is true, Sentis broadcasts the tensor values to additional channels in the render texture. For example, a tensor with a single channel R maps to (R, R, R, R) if channels is 4. When the value is false, Sentis applies a (0, 0, 0, 1) color mask to additional channels in the render texture. For example, a tensor with a single channel R becomes (R, 0, 0, 1) if channels is 4.

    Returns
    Type Description
    RenderTexture

    The created render texture.

    ToTexture(TensorFloat, TextureTransform)

    Converts the data in a tensor to a render texture. Sentis only writes batch == 0 to the render texture.

    If the width and height of the output tensor don't match the width and height of the texture, Sentis applies linear resampling.

    Declaration
    public static RenderTexture ToTexture(TensorFloat tensor, TextureTransform transform)
    Parameters
    Type Name Description
    TensorFloat tensor

    The input tensor.

    TextureTransform transform

    The optional settings for the conversion. Refer to TextureTransform for more information.

    Returns
    Type Description
    RenderTexture

    The created render texture.

    ToTexture(CommandBuffer, TensorFloat, TextureTransform)

    Appends the conversion of the data in a tensor to a render texture in a CommandBuffer. Sentis only writes batch == 0 to the render texture.

    If the width and height of the output tensor don't match the width and height of the texture, Sentis applies linear resampling.

    Declaration
    public static RenderTexture ToTexture(this CommandBuffer cb, TensorFloat tensor, TextureTransform transform)
    Parameters
    Type Name Description
    CommandBuffer cb

    The CommandBuffer buffer to append graphics command to.

    TensorFloat tensor

    The input tensor.

    TextureTransform transform

    The optional settings for the conversion. Refer to TextureTransform for more information.

    Returns
    Type Description
    RenderTexture

    The created render texture.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)