Class Layout


  • public class Layout
    extends Wrapper
    Layout represents the text information of tensor's dimensions/axes. E.g. layout `NCHW` means that 4D tensor `{-1, 3, 480, 640}` will have:
    • 0: `N = -1`: batch dimension is dynamic
    • 1: `C = 3`: number of channels is '3'
    • 2: `H = 480`: image height is 480
    • 3: `W = 640`: image width is 640
    Examples: `Layout` can be specified for:
    • Preprocessing purposes. E.g.
      • To apply normalization (means/scales) it is usually required to set 'C' dimension in a layout.
      • To resize the image to specified width/height it is needed to set 'H' and 'W' dimensions in a layout
      • To transpose image - source and target layout can be set (see `ov::preprocess::PreProcessSteps::convert_layout`)
    • To set/get model's batch (see Model.get_batch()/'set_batch') it is required in general to specify 'N' dimension
    in layout for appropriate inputs
    • Constructor Detail

      • Layout

        public Layout​(java.lang.String str)
    • Method Detail

      • height_idx

        public static int height_idx​(Layout layout)
        Returns 'height' dimension index.
      • width_idx

        public static int width_idx​(Layout layout)
        Returns 'width' dimension index.
      • delete

        protected void delete​(long nativeObj)
        Overrides:
        delete in class Wrapper