Page cover

Websocket

Connect to Docker Stream Websocket.

Getting Started

Explanation about websocket connection.

Websockets are a technology that enables real-time communication between a client (such as a browser or application) and a server. They are used to consume real-time event data, particularly useful in applications that rely on immediate data updates like those involving AI model inferences in systems such as VisionAIre Stream.

When an AI model completes an inference task, such as object detection or facial recognition, the results need to be communicated instantly to users or other systems. This is where WebSockets come into play. Unlike traditional HTTP connections that require a new connection for each request/response cycle, a WebSocket establishes a persistent, full-duplex connection over a single TCP connection. This means once the connection is open, data can be sent back and forth between the client and server in real time without the overhead of establishing new connections.

In the context of a dashboard that monitors real-time events, this technology allows for the immediate push of data from server to client as soon as an AI model inference is completed. This ensures that the dashboard can update instantaneously, providing users with real-time alerts and monitoring capabilities. The continuous and instant nature of data transmission via Websockets is crucial for applications requiring immediate data processing and display, enhancing responsiveness and user experience.

To help you understand WebSocket in detail, please check the article reference below:

This article is not affiliated by Nodeflux, but can help you to understand websocket connection in depth.

Websocket Construct

To construct additional parameters for web socket query:

General Analytics

For Multi Logics Analytics (People or Vehicle Analytics)

Example Response

Face Recognition

Face Recognition with Person Attributes

Key

Type

Description

analytic_id

string

Type of analytic. NFV4-FR is Face Recognition

image_jpeg

string

Image of captured object in base64 string.

node_num

int

The node number computation. If you only have a single instance, thennode = 0.

pipeline_data

object

The output of each analytics.

confidence_detection

float

The confidence score of face detection.

face-id

int

Unique identifier of the captured face.

similarity

float

Value of face embedding similarity between detected face and enrolled face.

status

string

The Status information of enrolled photo

variation

string

The unique id of the captured face image.

primary_text

string

KNOWN or UNKNOWN label of the detected face. Known when the face is recognized and UNKNOWN when the face is unrecognized.

secondary_text

string

This key was left empty.

stream_address

string

The original address of stream/camera.

stream_id

string

The unique id of the assigned stream/camera.

timestamp

string

Unix timestamp of the detected face.

event_id

string

Timestamp with 8 char hash

License Plate Recognition 1

License Plate Recognition 2

License Plate Recognition with Multiple Classes

Key

Type

Description

analytic_id

string

Type of analytic.

jpeg

string

Image of captured object in base64 string.

pipeline_data

object

The output of each analytics.

label

string

Class of detected objects, currently support car, motorcycle, bus, and truck

area_name

string

Area name of captured plate and vehicle.

direction

string

Direction of vehicle in ROI: Down, Up, Right and Left

event_id

string

Timestamp with 8 char hash

confidence

float

Confidence the vehicle classification

plate_type

string

Class of vehicle plate number such as APH or public

plate_number

string

The plate character prediction.

stream_address

string

The original address of stream/camera.

stream_id

string

The unique id of the assigned stream/camera.

timestamp

string

Unix timestamp of the detected vehicle and plate.

Vehicle Counting

Vehicle Analytics

Vehicle Analytics with Attributes

Key

Type

Description

analytic_id

string

Type of analytic. NFV4-VC is Vehicle Counting.

image_jpeg

string

Image of captured object in base64 string.

node_num

int

The node number computation. If you only have a single instance, thennode = 0.

pipeline_data

object

The output of each analytics.

area_name

string

Area name of the captured event.

confidence

float

Confidence the vehicle classification.

label

string

Classification of the captured vehicle.

primary_text

string

The vehicle classification prediction.

secondary_text

string

This key was left empty.

stream_address

string

The original address of stream/camera.

stream_id

string

The unique id of the assigned stream/camera.

timestamp

string

Unix timestamp of the detected vehicle.

event_id

string

Timestamp with 8 char hash

People Counting

Key

Type

Description

analytic_id

string

Type of analytic. NFV4-PC is People Counting

image_jpeg

string

Image of captured object in base64 string.

node_num

int

The node number computation. If you only have a single instance, thennode = 0.

pipeline_data

object

The output of each analytics.

area_name

string

Area name of the captured event.

confidence

float

Confidence the person classification

label

string

Classification of the captured person

primary_text

string

The people classification prediction.

secondary_text

string

This key was left empty.

stream_address

string

The original address of stream/camera.

stream_id

string

The unique id of the assigned stream/camera.

timestamp

string

Unix timestamp of the detected person.

event_id

string

Timestamp with 8 char hash

People Analytics

People Analytics with Attributes

Crowd Estimation

Key

Type

Description

analytic_id

string

Type of analytic. NFV4-CE is Crowd Estimation.

image_jpeg

string

Image of captured object in base64 string.

node_num

int

The node number computation. If you only have a single instance, thennode = 0.

pipeline_data

object

The output of each analytics.

area

string

Area name of captured the crowd.

estimation

float

Estimation number of people in the crowd.

interval

int

Interval of data dumping.

primary_text

string

Estimation number of people in the crowd.

secondary_text

string

Area name of captured the crowd.

stream_address

string

The original address of stream/camera.

stream_id

string

The unique id of the assigned stream/camera.

timestamp

string

Unix timestamp of the estimation dumping

event_id

string

Timestamp with 8 char hash

PPE Detection

Key
Type
Description

id

string

Event id where object appear on frame

helmet

boolean

True or False. to check wether helmet appear with object

helmet_location_on_head

boolean

True or False. to check wether helmet is wore on head

vest

boolean

True or False. to check wether vest is wore by object or not

glasses

boolean

True or False. to check wether glasses is wore by object or not

Water Level Monitoring

Pre-Flood Monitoring (NFV4D-FLOD)

Person Smoking Detection (NFV4D-PSMO)

Person with Handphone Detection (NFV4D-PPHO)

Smoke and Fire Detection (NFV4D-FISO)

Person with Firearms Detection (NFV4D-PPFA)

Vandalism Attempt Recognition (NFV4D-VMVD)

ATM Burglary Incident Recognition (NFV4D-VMBG)

Road Crash Monitoring (NFV4D-RCMA)

People Fighting Recognition (NFV4D-VMFG)

Riot Recognition (NFV4D-RIOT)

Tutorial to test WebSocket, you can try here:

Or you can connect via Vanilla Websocket instead

Connect to Vanilla Websocket

Last updated

Was this helpful?