Notifications

SmartFace Platform provides realtime information about events that are happening during processing video streams or uploaded files. This information is provided in the form of notifications based on GraphQL Subscriptions and the ZeroMQ Messages; information is also stored in the database.

Several types of events are recognezed in SmartFace Platform and notification of particular event are sent continuously for every event that occurs.

Providers

SmartFace Notifications are provided by two technologies, namely:

GraphQL Subscriptions

Notifications from the SmartFace Platform can be read using GraphQL API, typically available on port 8097, at HTTP endpoint http://<your_server_name>:8097/graphql.

GraphQL schema can be downloaded through the URL: http://<your_server_name>:8097/graphql?sdl

For more information about the GraphQL API, please read the integration section.

ZeroMQ messaging

The SmartFace Platform is publishing the notifications also through ZeroMQ messaging library. ZeroMQ uses sockets for communication, thus the host and a port needs to be specified. SmartFace Platform uses by default TCP port 2406.

ℹ️ If you want to listen to notifications from a different machine, please make sure that the port used on the host machine is not blocked by the firewall or is not used by any other software.

For more information about the ZeroMQ and some integration samples, please take a look at the integration section.

Types of notifications

Two types of notifications are recognized in SmartFace Platform

  • Database notifications which are most common notification type. Notification is first stored in the database and afterwards sent to subscribers. This ensures that data present in notification can be instantly queried through API.

  • Direct notifications are sent immediately after an event happens without waiting for the event to be stored in the database.

The following figure displays the main types of notifications:

Writing the information about the recognized events in the database may take a different time, which can cause notifications to be published in a different order than the original sequence of recognized events. This may particularly apply for notifications about matching as these notifications aren’t triggered when information is written into the database, but directly after the matching result is available.

Notifications topics

There are several types of notifications SmartFace Platform provides to you. These types are called topics. You can subscribe to topics listed in the following two tables.

Direct notifications

Direct Notifications consist of all data captured by the camera or edge stream. These notifications are immediately sent upon data availability, even before the event is saved to the database.

They are transmitted regardless of the set save strategies. Even if the saving strategy into the database is turned off, these notifications will still be sent.

Direct notifications can be received through both GraphQL and ZeroMQ channels.

GraphQL nameDescriptionContained information
FaceProcessedThe detected face from the processed input.It contains information about face, frame, match, and spoofcheck.
PedestrianProcessedThe detected pedestrian from the processed input.It contains information about pedestrian and frame.
ObjectProcessedThe detected object from the processed input.It contains information about object and frame.

Database notifications

Notifications sent when the event is stored in the database:

GraphQL nameZeroMQ nameTrigger
faceCreatedfaces.insertThe detected face has been saved into the database. Some properties haven’t been extracted yet.
faceExtractedfaces.extractedFace properties (such as age, gender, and presence of a face mask) were extracted and updated in the database.
matchResultInsertmatchResults.match.insertThe detected face from the processed input was matched with a watchlist member and this information has been saved into the database.
trackletCompletedtracklets.completedThe tracked face or pedestrian has been lost from tracking and this information has been updated in the database.
heartbeatThe notification is triggered automatically every second and contains a timestamp (current UTC). Can indicate communication online.
videoRecordNotification StateChangedvideoRecords.updateThe notification is used when SmartFace Platform is processing uploaded video files. The state of the video file is changed.

State:

Ready = 0, // Processing did not start yet

Processing = 1, // VideoRecord is processing

Processed = 2, // VideoRecord was successfully processed

Error = 3, // Processing error occurred
progressMessagegrouping_progress.infoFrames uploaded to RecordGrouping are being processed.

ProgressStatus:

Processing = 1 (contains unprocessed frames),

Ready = 2 (all frames processed).
pedestrianInsertedpedestrians.insertThe detected pedestrian was saved into the database.