Face Detection and Tracking#
Overview#
The main process is a Video Inference Service consists of face detection, object tracker, message producer, etc. It uses HTTP API for adding or removing input video streams dynamically.
The secondary process is a Controller Sidecar that drives the HTTP API call to Video Inference Service. It keeps querying current live video stream URLs from Audio-Video Stream Provider, then compare with current processing video stream URL in Video Inference Service. Finally query Video Inference Service to update input video stream, eg removing old one and add new one.

Input:
Audio-Video Stream Provider endpoint;
Stable video stream in RTSP provided by Audio-Video Stream Provider
Output:
Message stream of per frame face bounding box;
Supported Platforms: x86 dGPU
Deployment requirements: Make sure k8s foundational services are running
Features:
Face Detect
Dynamic input video stream update
Automatic input video stream reconnect upon lossing data for certain time
Algorithms:
Video Inference Service
Implements HTTP service to add and remove input video streams dynamically
Face Detection produces face label and bounding box coordinates
Tracker produces tracking ID to indicate the same face object
Each video stream has its unique ID from Audio-Video Stream Provider, the same ID will be associated with metadata in output message stream
Controller Sidecar process
Uses Audio-Video Stream Provider’s client and Video Inference Service client to query running streams periodically, eg default interval is 15 seconds
Compare running video streams list from Video Inference Service and Audio-Video Stream Provider, and find out the delta
For each interval, apply the delta to Video Inference Service by removing old streams no longer in Audio-Video Stream Provider, and new streams just appear in Audio-Video Stream Provider
Usage#
Sample Params:
ds-visionai:
rtspReconnectInterval: 10
redisCfg:
payloadkey: metadata
topic: "visionai"
controllerSidecar:
recessPeriod: "15s"
Sample Connections:
connections:
ds-visionai/vms: vms/vms
ds-visionai/redis: redis/redis
<DOWNSTREAM_BBOX_ANALYTICS_MS>/redis: redis/redis
Note
In this example, vms is the name of microservice Audio-Video Stream Provider; ds-visionai is the name of microservice Face Detection and Tracking.
vms –> http(for input stream URL) –> ds-visionai(Controller Sidecar)
vms –> RTSP(for input stream) –> ds-visionai(Video Inference Service)
ds-visionai –> redis –> <DOWNSTREAM_BBOX_ANALYTICS_MS>
All Parameters:
Param |
Description |
---|---|
dsServicePort: (integer ) |
DS service port. Default 8084 |
remoteAccess: (string ) |
Enable remote access or localhost only. Default ‘True’ |
addStreamApiPath: (string ) |
API path for service to add a stream. Default AddStream |
removeStreamApiPath: (string ) |
API path for service to remove a stream. Default RemoveStream |
getStatusApiPath: (string ) |
API path for service to get status. Default Status |
apiResourceName: (string ) |
REST API resource name for stream. Default stream |
recycleSourceId: (string ) |
Recycle and reuse DS internal source-id upon removing a stream. Default ‘False’ [Mandatory:False, Allowed Values:{ True, False }] |
maxNumSources: (integer ) |
max number of sources allowed to add. Default 6 |
batchSize: (integer ) |
batch size for streammux and inference. Default 8 |
rtspReconnectInterval: (integer ) |
Timeout in seconds to wait since last data was received from an RTSP source before forcing a reconnection. 0=disable timeout. Default 10 |
rtpProtocol: (integer ) |
RTP protocol to use. 0 for TCP/UDP; 4 for TCP Only. Default 0 [Mandatory:False, Allowed Values:{ 0, 4 }] |
peerPadIdSameAsSourceId: (string ) |
Use id comes from source stream in streammux stream index. Default ‘True’ [Mandatory:False, Allowed Values:{ true, false }] |
jitterbufferLatency: (integer ) |
Pipeline source component Jitterbuffer size in milliseconds. Default 100 [Mandatory:False] |
fileLoop: (string ) |
loop a file input. Default ‘True’ [Mandatory:False, Allowed Values:{ true, false }] |
msgConvPayloadType: (integer ) |
DS msgbroker payload schema. 0 DS; 1 DS minimal; 256 Reserved; 257 Custom. Default 1 [Mandatory:False, Allowed Values:{ 0, 1, 256, 257 }] |
redisCfg: (object ) |
Redis broker config |
|
Payload key for messages. Default metadata |
|
topic or stream name for redis messages. Default ‘test’ |
enableLatency: (string ) |
Whether to enable per frame latency measure. Default ‘false’ [Mandatory:False, Allowed Values:{ true, false }] |
enableCompLatency: (string ) |
Whether to enable per component latency; only used when enableLatency is ‘True’. Default ‘False’ [Mandatory:False, Allowed Values:{ true, false }] |
videoSink: (string ) |
type of video sink. Default ‘none’ [Mandatory:False, Allowed Values:{ rtsp, fake, file, none }] |
sinkSync: (string ) |
pipeline sink component sync on the clock. Default ‘false’ [Mandatory:False, Allowed Values:{ true, false }] |
controllerSidecar: (object ) |
service controller sidecar config |
|
service controller operate interval in seconds. Default value is 15s |
|
Use http or https to setup vms http client. Default ‘False’ [Mandatory:False, Allowed Values:{ True, False }] |
|
vms get streams API. Default ‘api/device/streams’ |
|
Whether to query VMS for an RTSP stream. Default ‘True’ [Mandatory:False, Allowed Values:{ true, false }] |
streammuxResolution: (object ) |
DS input video resolution config |
|
expected video frame height. Default 1080 |
|
expected video frame width. Default 1920 |
checkInterval: (string ) |
init container check interval in seconds. Default ‘1’ |