Virtual Columns

Prev Next

A virtual column is a column whose values are computed during query execution using a chosen function applied over real columns in the catalog table.  

The video below shows creating a view with virtual columns. The catalog table has a bounding box as a JSON string with 4 corner co-ordinates in the form of {"x_left":<>, "x_right":<>, "y_top":<>, "y_bottom":<>}.

  • The bounding box area is defined on a column of type bounding box.

  • The bounding box type required for the above definition is defined on the column that contains the bounding box coordinates as a JSON string.

While creating a view, after you have added the Type Mapping, you can also set up the Virtual Columns for the view.

  1. In the Virtual Columns tab, add the required virtual columns, as needed.

    For example, click the Add Virtual Columns button, and select Integer Splitter or String Splitter to define a new virtual column that splits an existing column and extracts a field at a specific position..

    1. Integer Splitter: Splits a string by a delimiter and extracts a specific position from the split result in the form of an integer. The position can be a negative value, zero, or a positive values. The return value will be an integer.

    2. String Splitter: Splits a string by a delimiter and extracts a specific position from the split result in the form of a string. The position can be a negative value, zero, or a positive values. The return value will be a string.

  2. Similarly, you can add other applicable virtual columns such as Segmentation Prediction and provide the segment with prediction class, as applicable.

    Some of the virtual column types for 2D object detection and segmentation are listed in the tables below.

  3. Click Preview.

  4. Review the preview results and click Save View.

Once the view is saved, the virtual column behaves like any other real column and is available for use in query filter conditions, just like any other real column. For example, the gt_area column created in the above video can be used in query conditions like (gt_area > 0.5) to filter out rows with a bounding box that occupies more than 50% of the image.

Virtual column types for 2D object detection

Type name

Output

Input

AKD_2DBoundingBox
AKD_2DBoundinBoxAbs
AKD_2DBoundingBoxCOCOJSON
AKD_2DBoundingBoxJSON

A 2D bounding box defined by return type boundingbox2d

  • AKD_2DBoundingBox - Takes four individual coordinate columns with coordinate values normalized between 0 and 1.

  • AKD_2DBoundinBoxAbs - Takes four individual coordinate columns with absolute pixel values and an image height and width column.

  • AKD_2DBoundingBoxCOCOJSON - Takes a single column that holds bounding box in COCO bounding box format([x_left, y_top, box_width, box_height]) and image height and width columns.

  • AKD_2DBoundingBoxJSON - Takes a single column with a JSON string formatted bounding box coordinates normalized between 0 and 1. The JSON is in the {x_left:<>, x_right:<>, y_top:<>, y_bottom:<>} format.

AKD_2DBoundingBoxGT

A 2D object detection ground truth with class and bounding box.

  • 2D Bounding box of type boundingbox2d specified using any supported input types described above.

  • A class label of type string or a mapped class type classlabelgt.

AKD_2DBoundingBoxPred

A 2D object detection prediction with class, bounding box, and prediction confidence.

  • Input set 1

    • 2D Bounding box of type boundingbox2d specified using any supported input types described above.

    • A class label of type string or a mapped class type classlabelpred.

    • Prediction confidence of type float or double.

  • Input set 2

    • 2D Bounding box of type boundingbox2d specified using any supported input types described above.

    • A column that is defined using classlabelwithconfidence type that combines class label and prediction confidence.

AKD_2DBoundingBoxArea

Area of a 2D bounding box

  • 2D Bounding box of type boundingbox2d specified using any supported input types described above.

Virtual column types for segmentation

Type name

Output

Input

AKD_SegmentJson

An instance segment represented by the type 'segment'.

  • A column with JSON that represents the segment in polygon format as [x1, y1, x2, y2,...] with (x1, y1), (x2, y2) etc being the vertex coordinates for polygon making up the segment.

  • mask_width and mask_height columns that represent the width and height of the image used to define the segment coordinates.

AKD_SegmentGt

An instance segment with a ground truth.

  • A column of type 'segment'. Currently, AKD_SegmentJson above should be used to define a segment.

  • A column with a ground truth label.

AKD_SegmentPred

An instance segment with a prediction.

  • Input set 1

    • A column of type 'segment'. Currently, AKD_SegmentJson above should be used to define a segment.

    • A class label of type string or a mapped class type classlabelpred.

    • Prediction confidence of type float or double.

  • Input set 2

    • A column of type 'segment'. Currently, AKD_SegmentJson above should be used to define a segment.

    • A column that is defined using classlabelwithconfidence type that combines class label and prediction confidence.