Skip to main content

Code Transformations

While a lot of Video Intelligence platforms give you the ability to upload custom models, many of them do not allow you to create metadata based on custom logic. VisualCortex has Code Transformations which allow you to do just that.

Code Transformations are written in Typescript and allow you to add, remove and augment metadata detections in your application. Code transformations can be applied to both Live Cameras and Virtual Cameras.

Reach out to VisualCortex Support to get technical documentation on syntax, interfaces and samples for code transformations.

Sample Use Cases

Grouping Classes

You might decide you want to use VisualCortex's built-in Pedestrian model, which outputs a variety of classes. These include both person and bicycle.

A visualisation of what VisualCortex might detect is below:

Person and Bicycle

If you were to define a Directional Count Event Definition, you'd see 4x person events and 4x bicycle events. While technically accurate, you might want to count people without bicycles separately and not include people riding bicycles in that figure.

A code transformation could look at the overlapping coordinates of people and bicycles and instead create a New classification - cyclist.

Cyclist

This way, person and cyclist become separate objects, while bicycle gets removed, allowing you to get a more representative count of traffic in an area.

Speed

Code Transformations have access to any Event Definitions defined for a camera. You may decide to define a 2x2m zone and utilise that to understand how quick an object is moving. In this example below, icons above the people change depending on whether or not the running attribute has been added to a person.