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.
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..
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.
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.
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.
Click Preview.
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 | A 2D bounding box defined by return type boundingbox2d |
|
AKD_2DBoundingBoxGT | A 2D object detection ground truth with class and bounding box. |
|
AKD_2DBoundingBoxPred | A 2D object detection prediction with class, bounding box, and prediction confidence. |
|
AKD_2DBoundingBoxArea | Area of a 2D bounding box |
|
Virtual column types for segmentation
Type name | Output | Input |
AKD_SegmentJson | An instance segment represented by the type 'segment'. |
|
AKD_SegmentGt | An instance segment with a ground truth. |
|
AKD_SegmentPred | An instance segment with a prediction. |
|