Video face detection: findface-video-manager and findface-video-worker

Note

The findface-video-worker is delivered in a CPU-accelerated (findface-video-worker-cpu) and a GPU-accelerated (findface-video-worker-gpu) packages.

In this section:

Functions of findface-video-manager

The findface-video-manager service is the part of the video face detection module that is used for managing the video face detection functionality.

The findface-video-manager service interfaces with findface-video-worker as follows:

  • It supplies findface-video-worker with settings and the list of to-be-processed video streams. To do so, it issues a so-called job, a video processing task that contains configuration settings and stream data.
  • In a distributed system, it distributes video streams (jobs) across vacant findface-video-worker instances.

Note

Configuration settings passed via jobs have priority over the findface-video-manager configuration file.

The findface-video-manager service functioning requires ETCD, third-party software that implements a distributed key-value store for findface-video-manager. In the FindFace core, ETCD is used as a coordination service, providing the video face detector with fault tolerance.

Functionality:

  • allows for configuring video face detection parameters,
  • allows for managing the list of to-be-processed video streams,
  • implements video face detection management.

Functions of findface-video-worker

The findface-video-worker service (on CPU/GPU) is the part of the video face detection module, that recognizes faces in the video. It can work with both live streams and files, and supports most video formats and codecs that can be decoded by FFmpeg.

The findface-video-worker service interfaces with the findface-video-manager and findface-facerouter services as follows:

  • By request, findface-video-worker gets a job with settings and the list of to-be-processed video streams from findface-video-manager.
  • The findface-video-worker posts extracted normalized face images, along with the full frames and meta data (such as bbox, camera ID and detection time) to the findface-facerouter service for further processing.

Note

In FindFace Security, the findface-facerouter functions are performed by findface-security.

Functionality:

  • detects faces in the video,
  • extracts normalized face images,
  • searches for the best face snapshot,
  • snapshot deduplication (only one snapshot per face detection event).

When processing video, findface-video-worker consequently uses the following algorithms:

  • Motion detection. Used to reduce resource consumption. Only when the motion detector recognizes the motion of certain intensity that the face tracker can be triggered.
  • Face tracking. The face tracker traces, detects and captures faces in the video. It can simultaneously be working with several faces. It also searches for the best face snapshot, using an embedded neural network. After the best face snapshot is found, it is posted to findface-facerouter.

The best face snapshot can be found in one of the following modes:

  • Real-time
  • Offline

Real-Time Mode

In the real-time mode, findface-video-worker posts a face on-the-fly after it appears in the camera field of view. The following posting options are available (see /etc/findface-video-manager.conf or Add Camera):

  • If realtime_post_every_interval: true, the face tracker searches for the best face snapshot within each time period equal to realtime_post_interval and posts it to findface-facerouter.
  • If realtime_post_every_interval: false, the face tracker searches for the best face snapshot dynamically:
    1. First, the face tracker estimates whether the quality of a face snapshot exceeds a pre-defined internal threshold. If so, the snapshot is posted to findface-facerouter.
    2. The threshold value increases after each post. Each time the face tracker gets a higher quality snapshot of the same face, it is posted.
    3. When the face disappears from the camera field of view, the threshold value resets to default.
  • If realtime_post_first_immediately: true, the face tracker doesn’t wait for the first realtime_post_interval to complete and posts the first face from a track immediately after it passes through the quality, size, and ROI filters. The way the subsequent postings are sent depends on the realtime_post_every_interval value. If realtime_post_first_immediately: false, the face tracker posts the first face after the first realtime_post_interval completes.

Offline Mode

The offline mode is less storage intensive than the real-time one as in this mode findface-video-worker posts only one snapshot per track, but of the highest quality. In this mode, the face tracker buffers a video stream with a face in it until the face disappears from the camera field of view. Then the face tracker picks up the best face snapshot from the buffered video and posts it to findface-facerouter.

By default, the offline mode is enabled through the overall_only parameter ( see /etc/findface-video-manager.conf or Add Camera).

Configure Video Face Detection

The video face detector configuration is done through the following configuration files:

  1. The findface-video-manager configuration file /etc/findface-video-manager.conf:

    listen: 127.0.0.1:18810
    etcd:
      endpoints: 127.0.0.1:2379
      dial_timeout: 3s
    kafka:
      enabled: false
      endpoints: 127.0.0.1:9092
    master:
      lease_ttl: 10
      self_url: 127.0.0.1:18811
      self_url_http: 127.0.0.1:18810
    rpc:
      listen: 127.0.0.1:18811
      heart_beat_timeout: 4s
    router_url: http://127.0.0.1:18820/v0/frame
    exp_backoff:
      enabled: false
      min_delay: 1s
      max_delay: 1m0s
      factor: 2
      flush_interval: 2m0s
    ntls:
      enabled: false
      url: http://127.0.0.1:3185/
      update_interval: 1m0s
    prometheus:
      jobs_processed_duration_buckets:
      - 1
      - 30
      - 60
      - 500
      - 1800
      - 3600
      - 21600
      - .inf
    job_scheduler_script: ''
    stream_settings:
      ffmpeg_params: []
      md_threshold: 0.002
      md_scale: 0.3
      fd_frame_height: -1
      uc_max_time_diff: 30
      uc_max_dup: 3
      uc_max_avg_shift: 10
      det_period: 8
      realtime: false
      npersons: 4
      disable_drops: false
      tracker_threads: 4
      parse_sei: false
      image_arg: photo
      additional_headers: []
      additional_body: []
      api_timeout: 15000
      api_ssl_verify: true
      post_uniq: true
      min_score: -2
      min_d_score: -1000
      realtime_dly: 500
      realtime_post_perm: false
      rot: ''
      roi: ''
      draw_track: false
      send_track: 0
      min_face_size: 0
      max_face_size: 0
      overall: true
      only_norm: false
      max_candidates: 0
      jpeg_quality: 95
      ffmpeg_format: ''
    stream_settings_gpu:
      play_speed: -1
      filter_min_quality: 0.45
      filter_min_face_size: 1
      filter_max_face_size: 8192
      normalized_only: false
      jpeg_quality: 95
      overall_only: false
      use_stream_timestamp: false
      ffmpeg_params: []
      router_timeout_ms: 15000
      router_verify_ssl: true
      router_headers: []
      router_body: []
      start_stream_timestamp: 0
      imotion_threshold: 0
      rot: ''
      roi: ''
      realtime_post_interval: 1
      realtime_post_every_interval: false
      ffmpeg_format: ''
      disable_drops: false
      router_full_frame_png: false
      router_disable_normalized: false
      crop_fullframe_rot: false
      realtime_post_first_immediately: false
      post_first_track_frame: false
      post_last_track_frame: false
      track_max_duration_frames: 0
      send_track_history: false
      stream_data_filter: ''
    

When configuring findface-video-manager, refer to the following parameters:

Option Description
etcd -> endpoints IP address and port of the etcd service. Default value: 127.0.0.1:2379.
ntls -> enabled If true, findface-video-manager will send a job to findface-video-worker only if the total number of processed cameras does not exceed the allowed number of cameras from the license. Default value: false.
ntls -> url IP address and port of the findface-ntls host. Default value: http://127.0.0.1:3185/.
router_url IP address and port of the findface-facerouter host to receive detected faces from findface-video-worker. In FindFace Security, findface-facerouter functions are performed by findface-security. Default value: http://127.0.0.1:18820/v0/frame.

You can also configure the following parameters:

Note

In the stream_settings-gpu section of the file, you will find general settings for all video streams. The settings in this section work for both CPU and GPU configuration. Settings of a particular stream, passed in a job, have priority over those in the configuration file (see Jobs).

Note

The stream_settings section of the file is deprecated and necessary only for backward compatibility.

Option Description
crop_fullframe_rot Crop posted full frames by ROT. Default value: false.
disable_drops Enables posting all appropriate faces without drops. By default, if findface-video-worker does not have enough resources to process all frames with faces, it drops some of them. If this option is active, findface-video-worker puts odd frames on the waiting list to process them later. Default value: false.
ffmpeg_format Pass FFMPEG format (mxg, flv, etc.) if it cannot be detected automatically.
ffmpeg_params List of a video stream ffmpeg options with their values as a key=value array: [“rtsp_transpotr=tcp”, .., “ss=00:20:00”]. Check out the FFmpeg web site for the full list of options. Default value: options not specified.
filter_max_face_size Maximum size of a face in pixels. Oversized faces are not posted. Default value: 8192.
filter_min_face_size Minimum size of a face in pixels. Undersized faces are not posted. Default value: 1.
filter_min_quality Minimum threshold value for a face image quality. Default value: 0.45. Do not change the default value without consulting with our technical experts (support@ntechlab.com).
imotion_threshold Minimum motion intensity to be detected by the motion detector. The threshold value is to be fitted empirically. Empirical units: zero and positive rational numbers. Milestones: 0 = detector disabled, 0.002 = default value, 0.05 = minimum intensity is too high to detect motion.
jpeg_quality Quality of an original frame JPEG compression, in percents. Default value: 95%.
normalized_only Enable posting only normalized face images without full frames. Default value: false.
overall_only Enables the offline mode for the best face search. Default value: true.
play_speed If less than zero, the speed is not limited. In other cases, the stream is read with the given play_speed. Not applicable for live streams.
post_first_track_frame Post the first frame of a track. Default value: false.
post_last_track_frame Post the last frame of a track. Default value: false.
realtime_post_every_interval Only for the realtime mode. Post best snapshots obtained within each realtime_post_interval time period. If false, search for the best snapshot dynamically and send snapshots in order of increasing quality. Default value: false.
realtime_post_first_immediately Enable posting a face right after it appears in a camera field of view (real-time mode). Default value: false.
realtime_post_interval Only for the real-time mode. Defines the time period in seconds within which the face tracker picks up the best snapshot and posts it to findface-facerouter. Default value: 1.
router_body Additional body fields in a request body when posting a face: [“key = value”]. Default value: body fields not specified.
roi Enable posting faces detected only inside a region of interest WxH+X+Y. Default value: region not specified.
rot Enables detecting and tracking faces only inside a clipping rectangle WxH+X+Y. You can use this option to reduce findface-video-worker load. Default value: rectangle not specified.
router_disable_normalized Send only full frames without normalized images. Do not enable this parameter without supervision from our team as it can affect the entire system functioning. Default value: false (send full frames and normalized images).
router_full_frame_png Send full frames in PNG and not in JPEG as set by default. Do not enable this parameter without supervision from our team as it can affect the entire system functioning. Default value: false (send in JPEG).
router_headers Additional header fields in a request when posting a face: [“key = value”]. Default value: headers not specified.
router_timeout_ms Timeout for a findface-facerouter (or findface-security in the standard FindFace Security configuration) response to a findface-video-worker API request, in milliseconds. If the timeout has expired, the system will log an error. Default value: 15000.
router_verify_ssl Enables a https certificate verification when findface-video-worker and findface-facerouter (or findface-security in the standard FindFace Security configuration) interact over https. Default value: true. If false, a self-signed certificate can be accepted.
send_track_history Send track history. Default value: false.
start_stream_timestamp Add the specified number of seconds to timestamps from a stream.
use_stream_timestamp If true, retrieve and post timestamps from a video stream. If false, post the actual date and time.
  1. If you opt for the CPU-accelerated package findface-video-worker-cpu, use the /etc/findface-video-worker-cpu.ini configuration file:

    ## read streams from file, do not use VideoManager
    ## type:string env:CFG_INPUT longopt:--input
    input =
    
    ## exit on first finished job, only when --input specified
    ## type:bool env:CFG_EXIT_ON_FIRST_FINISHED longopt:--exit-on-first-finished
    exit_on_first_finished = false
    
    ## batch size
    ## type:number env:CFG_BATCH_SIZE longopt:--batch-size
    batch_size = 4
    
    ## http server port for metrics, 0=do not start server
    ## type:number env:CFG_METRICS_PORT longopt:--metrics-port
    metrics_port = 0
    
    ## resize scale, 1=do not resize
    ## type:double env:CFG_RESIZE_SCALE longopt:--resize-scale
    resize_scale = 1.000000
    
    ## maximum number of streams
    ## type:number env:CFG_CAPACITY longopt:--capacity
    capacity = 10
    
    ## command to obtain videomanager's grpc ip:port
    ## type:string env:CFG_MGR_CMD longopt:--mgr-cmd
    mgr_cmd =
    
    ## videomanager grpc ip:port
    ## type:string env:CFG_MGR_STATIC longopt:--mgr-static
    mgr_static = 127.0.0.1:18811
    
    ## ntls server ip:port
    ## type:string env:CFG_NTLS_ADDR longopt:--ntls-addr
    ntls_addr = 127.0.0.1:3133
    
    ## debug: save faces to dir
    ## type:string env:CFG_SAVE_DIR longopt:--save-dir
    save_dir =
    
    ## minimum face size
    ## type:number env:CFG_MIN_FACE_SIZE longopt:--min-face-size
    min_face_size = 60
    
    ## preinit detector for specified resolutions: "640x480;1920x1080"
    ## type:string env:CFG_RESOLUTIONS longopt:--resolutions
    resolutions =
    
    ## worker labels: labels = k=v;group=enter
    ## type:string env:CFG_LABELS longopt:--labels
    labels =
    
    ## use timestamps from SEI packet
    ## type:bool env:CFG_USE_TIME_FROM_SEI longopt:--use-time-from-sei
    use_time_from_sei = false
    
    ## reader frame buffer size
    ## type:number env:CFG_FRAME_BUFFER_SIZE longopt:--frame-buffer-size
    frame_buffer_size = 128
    
    ## skip count
    ## type:number env:CFG_SKIP_COUNT longopt:--skip-count
    skip_count = 2
    
    #------------------------------
    [streamer]
    #------------------------------
    ## streamer/shots webserver port, 0=disabled
    ## type:number env:CFG_STREAMER_PORT longopt:--streamer-port
    port = 18999
    
    ## streamer url - how to access this worker on streamer_port
    ## type:string env:CFG_STREAMER_URL longopt:--streamer-url
    url = 127.0.0.1:18999
    
    ## use tracks instead detects for streamer
    ## type:bool env:CFG_STREAMER_TRACKS longopt:--streamer-tracks
    tracks = false
    
    ## use tracks with lastFrameId=currentFrameId (.tracks must be true)
    ## type:bool env:CFG_STREAMER_TRACKS_LAST longopt:--streamer-tracks-last
    tracks_last = false
    
    #------------------------------
    [liveness]
    #------------------------------
    ## path to liveness fnk
    ## type:string env:CFG_LIVENESS_FNK longopt:--liveness-fnk
    fnk =
    
    ## path to normalization for liveness
    ## type:string env:CFG_LIVENESS_NORM longopt:--liveness-norm
    norm =
    
    ## liveness internal algo param
    ## type:double env:CFG_LIVENESS_INTERVAL longopt:--liveness-interval
    interval = 1.000000
    
    ## liveness internal algo param
    ## type:number env:CFG_LIVENESS_STDEV_CNT longopt:--liveness-stdev-cnt
    stdev_cnt = 1
    
    #------------------------------
    [imotion]
    #------------------------------
    ## use shared decoder for imotion (experimental)
    # type:bool env:CFG_IMOTION_SHARED_DECODER longopt:--imotion-shared-decoder
    shared_decoder = false
    
    ------------------------------
    [send]
    #------------------------------
    ## posting faces threads
    ## type:number env:CFG_SEND_THREADS longopt:--send-threads
    threads = 8
    
    ## posting faces maximum queue size
    ## type:number env:CFG_SEND_QUEUE_LIMIT longopt:--send-queue-limit
    queue_limit = 256
    
    #------------------------------
    [tracker]
    #------------------------------
    ## interpolate undetected bboxes in track
    ## type:bool env:CFG_TRACKER_INTERPOLATE_BBOXES longopt:--tracker-interpolate-bboxes
    interpolate_bboxes = true
    
    ## max face miss duration, sec
    ## type:double env:CFG_TRACKER_MISS_INTERVAL longopt:--tracker-miss-interval
    miss_interval = 1.000000
    
    ## overlap threshold
    ## type:double env:CFG_TRACKER_OVERLAP_THRESHOLD longopt:--tracker-overlap-threshold
    overlap_threshold = 0.250000
    
    #------------------------------
    [models]
    #------------------------------
    ## path to pedestrian detector fnk
    ## type:string env:CFG_MODELS_BODY_DETECTOR longopt:--models-body-detector
    body_detector =
    
    ## path to detector fnk
    ## type:string env:CFG_MODELS_DETECTOR longopt:--models-detector
    detector = /usr/share/findface-data/models/facedet/cheetah_fast.cpu.fnk
    
    ## path to quality fnk
    ## type:string env:CFG_MODELS_QUALITY longopt:--models-quality
    quality = /usr/share/findface-data/models/faceattr/quality.v1.cpu.fnk
    
    ## path to norm for quality fnk
    ## type:string env:CFG_MODELS_NORM_QUALITY longopt:--models-norm-quality
    norm_quality = /usr/share/findface-data/models/facenorm/bee_fast.cpu.fnk
    
    ## path to norm200 fnk, for face send
    ## type:string env:CFG_MODELS_NORM_200 longopt:--models-norm-200
    norm_200 =
    
    ## path to norm_crop2x fnk, for face send
    ## type:string env:CFG_MODELS_NORM_CROP2X longopt:--models-norm-crop2x
    norm_crop2x = /usr/share/findface-data/models/facenorm/crop2x.v2_maxsize400.cpu.fnk
    
    ## path to cache directory
    ## type:string env:CFG_MODELS_CACHE_DIR longopt:--models-cache-dir
    cache_dir = /var/cache/findface/models_cache
    

    If you opt for the GPU-accelerated package findface-video-worker-gpu, use the /etc/findface-video-worker-gpu.ini configuration file.

    ## cuda device number
    ## type:number env:CFG_DEVICE_NUMBER longopt:--device-number
    device_number = 0
    ## apply getprop patch
    ## type:bool env:CFG_PATCH_GETPROP longopt:--patch-getprop
    patch_getprop = false
    ## read streams from file, do not use VideoManager
    ## type:string env:CFG_INPUT longopt:--input
    input =
    ## exit on first finished job, only when --input specified
    ## type:bool env:CFG_EXIT_ON_FIRST_FINISHED longopt:--exit-on-first-finished
    exit_on_first_finished = false
    ## batch size
    ## type:number env:CFG_BATCH_SIZE longopt:--batch-size
    batch_size = 8
    ## http server port for metrics, 0=do not start server
    ## type:number env:CFG_METRICS_PORT longopt:--metrics-port
    metrics_port = 0
    ## resize scale, 1=do not resize
    ## type:double env:CFG_RESIZE_SCALE longopt:--resize-scale
    resize_scale = 1.000000
    ## maximum number of streams
    ## type:number env:CFG_CAPACITY longopt:--capacity
    capacity = 30
    ## command to obtain videomanager's grpc ip:port
    ## type:string env:CFG_MGR_CMD longopt:--mgr-cmd
    mgr_cmd =
    ## videomanager grpc ip:port
    ## type:string env:CFG_MGR_STATIC longopt:--mgr-static
    mgr_static = 127.0.0.1:18811
    ## ntls server ip:port
    ## type:string env:CFG_NTLS_ADDR longopt:--ntls-addr
    ntls_addr = 127.0.0.1:3133
    ## debug: save faces to dir
    ## type:string env:CFG_SAVE_DIR longopt:--save-dir
    save_dir =
    ## minimum face size
    ## type:number env:CFG_MIN_FACE_SIZE longopt:--min-face-size
    min_face_size = 60
    ## preinit detector for specified resolutions: "640x480;1920x1080"
    ## type:string env:CFG_RESOLUTIONS longopt:--resolutions
    resolutions =
    ## worker labels: labels = k=v;group=enter
    ## type:string env:CFG_LABELS longopt:--labels
    labels =
    ## use timestamps from SEI packet
    ## type:bool env:CFG_USE_TIME_FROM_SEI longopt:--use-time-from-sei
    use_time_from_sei = false
    ## reader frame buffer size
    ## type:number env:CFG_FRAME_BUFFER_SIZE longopt:--frame-buffer-size
    frame_buffer_size = 128
    ## skip count
    ## type:number env:CFG_SKIP_COUNT longopt:--skip-count
    skip_count = 0
    #------------------------------
    [streamer]
    #------------------------------
    ## streamer/shots webserver port, 0=disabled
    ## type:number env:CFG_STREAMER_PORT longopt:--streamer-port
    port = 18999
    ## streamer url - how to access this worker on streamer_port
    ## type:string env:CFG_STREAMER_URL longopt:--streamer-url
    url = 127.0.0.1:18999
    ## use tracks instead detects for streamer
    ## type:bool env:CFG_STREAMER_TRACKS longopt:--streamer-tracks
    tracks = false
    ## use tracks with lastFrameId=currentFrameId (.tracks must be true)
    ## type:bool env:CFG_STREAMER_TRACKS_LAST longopt:--streamer-tracks-last
    tracks_last = false
    #------------------------------
    [liveness]
    #------------------------------
    ## path to liveness fnk
    ## type:string env:CFG_LIVENESS_FNK longopt:--liveness-fnk
    fnk =
    ## path to normalization for liveness
    ## type:string env:CFG_LIVENESS_NORM longopt:--liveness-norm
    norm =
    ## liveness internal algo param
    ## type:double env:CFG_LIVENESS_INTERVAL longopt:--liveness-interval
    interval = 1.000000
    ## liveness internal algo param
    ## type:number env:CFG_LIVENESS_STDEV_CNT longopt:--liveness-stdev-cnt
    stdev_cnt = 1
    #------------------------------
    [imotion]
    #------------------------------
    ## use shared decoder for imotion (experimental)
    ## type:bool env:CFG_IMOTION_SHARED_DECODER longopt:--imotion-shared-decoder
    shared_decoder = false
    #------------------------------
    [send]
    #------------------------------
    ## posting faces threads
    ## type:number env:CFG_SEND_THREADS longopt:--send-threads
    threads = 8
    ## posting faces maximum queue size
    ## type:number env:CFG_SEND_QUEUE_LIMIT longopt:--send-queue-limit
    queue_limit = 256
    #------------------------------
    [tracker]
    #------------------------------
    ## interpolate undetected bboxes in track
    ## type:bool env:CFG_TRACKER_INTERPOLATE_BBOXES longopt:--tracker-interpolate-bboxes
    interpolate_bboxes = true
    ## max face miss duration, sec
    ## type:double env:CFG_TRACKER_MISS_INTERVAL longopt:--tracker-miss-interval
    miss_interval = 1.000000
    ## overlap threshold
    ## type:double env:CFG_TRACKER_OVERLAP_THRESHOLD longopt:--tracker-overlap-threshold
    overlap_threshold = 0.250000
    #------------------------------
    [models]
    #------------------------------
    ## path to pedestrian detector fnk
    ## type:string env:CFG_MODELS_BODY_DETECTOR longopt:--models-body-detector
    body_detector =
    ## path to detector fnk
    ## type:string env:CFG_MODELS_DETECTOR longopt:--models-detector
    detector = /usr/share/findface-data/models/facedet/cheetah_fast.gpu.fnk
    ## path to quality fnk
    ## type:string env:CFG_MODELS_QUALITY longopt:--models-quality
    quality = /usr/share/findface-data/models/faceattr/quality.v1.gpu.fnk
    ## path to norm for quality fnk
    ## type:string env:CFG_MODELS_NORM_QUALITY longopt:--models-norm-quality
    norm_quality = /usr/share/findface-data/models/facenorm/bee_fast.gpu.fnk
    ## path to norm200 fnk, for face send
    ## type:string env:CFG_MODELS_NORM_200 longopt:--models-norm-200
    norm_200 =
    ## path to norm_crop2x fnk, for face send
    ## type:string env:CFG_MODELS_NORM_CROP2X longopt:--models-norm-crop2x
    norm_crop2x = /usr/share/findface-data/models/facenorm/crop2x.v2_maxsize400.gpu.fnk
    ## path to cache directory
    ## type:string env:CFG_MODELS_CACHE_DIR longopt:--models-cache-dir
    cache_dir = /var/cache/findface/models_cache
    #------------------------------
    [video_decoder]
    #------------------------------
    ## decode video on cpu
    ## type:bool env:CFG_VIDEO_DECODER_CPU longopt:--video-decoder-cpu
    cpu = false
    

    When configuring findface-video-worker (on CPU/GPU), refer to the following parameters:

    CPU GPU Description
    batch_size Post faces in batches of the given size.
    capacity Maximum number of video streams to be processed by findface-video-worker.
    N/a cpu If necessary, decode video on CPU.
    N/a device_number GPU device number to use.
    exit_on_first_finished (Only if input is specified) Exit on the first finished job.
    input Process streams from file, ignoring stream data from findface-video-manager.
    labels Labels used to allocate a video face detector instance to a certain group of cameras. See Allocate findface-video-worker to Camera Group.
    liveness -> fnk Path to the face liveness detector.
    liveness -> norm Path to the normalizer used in the liveness detector.
    mgr-cmd (Optional, instead of the mgr-static parameter) A command to obtain the IP address of the findface-video-manager host.
    mgr-static IP address of the findface-video-manager host to provide findface-video-worker with settings and the list of to-be-processed streams.
    metrics_port HTTP server port to send metrics. If 0, the metrics are not sent.
    min_face_size Minimum face size to be detected.
    ntls-addr IP address and port of the findface-ntls host.
    resize_scale Rescale video frames with the given coefficient.
    resolutions Preinitialize findface-video-worker to work with specified resolutions. Example: “640x480;1920x1080”.
    save_dir (For debug) Save detected faces to the given directory.
    streamer -> port, url IP address and port to access the video wall.
    use_time_from_sei (For MPEG-2) Use SEI (supplemental enhancement information) timestamps.

Jobs

The findface-video-manager service provides findface-video-worker with a so-called job, a video processing task that contains configuration settings and stream data.

There are two job types:

  • camera:

    curl http://127.0.0.1:18810/job/ffsec-camera:22 | jq
    {
      "id": "ffsec-camera:22",
      "enabled": true,
      "stream_url": "rtsp://ntech:[email protected]:654/000000010000babe0000accc8e9e3a58/live",
      "labels": {},
      "router_url": "http://127.0.0.1/video-detector/frame",
      "single_pass": false,
      "stream_settings": {
        "ffmpeg_params": [],
        "md_threshold": 0.002,
        "md_scale": 0.3,
        "fd_frame_height": -1,
        "uc_max_time_diff": 30,
        "uc_max_dup": 3,
        "uc_max_avg_shift": 10,
        "det_period": 8,
        "realtime": false,
        "npersons": 4,
        "disable_drops": false,
        "tracker_threads": 4,
        "parse_sei": false,
        "image_arg": "photo",
        "additional_headers": [],
        "additional_body": [],
        "api_timeout": 15000,
        "api_ssl_verify": true,
        "post_uniq": true,
        "min_score": -2,
        "min_d_score": -1000,
        "realtime_dly": 500,
        "realtime_post_perm": false,
        "rot": "",
        "roi": "",
        "draw_track": false,
        "send_track": 0,
        "min_face_size": 0,
        "max_face_size": 0,
        "overall": true,
        "only_norm": false,
        "max_candidates": 0,
        "jpeg_quality": 95,
        "ffmpeg_format": ""
      },
      "stream_settings_gpu": {
        "play_speed": -1,
        "filter_min_quality": 0.45,
        "filter_min_face_size": 1,
        "filter_max_face_size": 8192,
        "normalized_only": false,
        "jpeg_quality": 95,
        "overall_only": false,
        "use_stream_timestamp": false,
        "ffmpeg_params": [],
        "router_timeout_ms": 15000,
        "router_verify_ssl": true,
        "router_headers": [
          "Authorization=Token 7db297c4107518b52b4e2195b72c5947"
        ],
        "router_body": [],
        "start_stream_timestamp": 0,
        "imotion_threshold": 0,
        "rot": "",
        "roi": "",
        "realtime_post_interval": 1,
        "realtime_post_every_interval": false,
        "ffmpeg_format": "",
        "disable_drops": false,
        "router_full_frame_png": false,
        "router_disable_normalized": false,
        "crop_fullframe_rot": false,
        "realtime_post_first_immediately": false
      },
      "status": "INPROGRESS",
      "status_msg": "",
      "statistic": {
        "processed_duration": 5729.5728,
        "faces_posted": 43,
        "faces_failed": 0,
        "faces_not_posted": 0,
        "processing_fps": 15.589469,
        "frames_dropped": 0,
        "frames_processed": 87121,
        "frames_imotion_skipped": 0,
        "decoding_soft_errors": 0,
        "frame_width": 1920,
        "frame_height": 1200,
        "job_starts": 1
      },
      "restream_url": "ws://127.0.0.1:18999/stream/ffsec-camera:22",
      "shots_url": "http://127.0.0.1:18999/shot/ffsec-camera:22",
      "worker_id": "tevmenova-ntechlab_gpu_2a1fd5290195670b689d8e01e93b673c",
      "version": "bt1s8kjm51nv2hqc4qg0"
    
  • video archive:

    curl http://127.0.0.1:18810/job/ffsec-video-archive:1 | jq
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2094    0  2094    0     0  2044k      0 --:--:-- --:--:-- --:--:-- 2044k
    {
      "id": "ffsec-video-archive:1",
      "enabled": true,
      "stream_url": "file:///var/lib/findface-security/uploads/videos/1.bin",
      "labels": {
        "camera_group_id": "1",
        "camera_id": ""
      },
      "router_url": "http://127.0.0.1/video-detector/frame",
      "single_pass": true,
      "stream_settings": {
        "ffmpeg_params": [],
        "md_threshold": 0.002,
        "md_scale": 0.3,
        "fd_frame_height": -1,
        "uc_max_time_diff": 30,
        "uc_max_dup": 3,
        "uc_max_avg_shift": 10,
        "det_period": 8,
        "realtime": false,
        "npersons": 4,
        "disable_drops": false,
        "tracker_threads": 4,
        "parse_sei": false,
        "image_arg": "photo",
        "additional_headers": [],
        "additional_body": [],
        "api_timeout": 15000,
        "api_ssl_verify": true,
        "post_uniq": true,
        "min_score": -2,
        "min_d_score": -1000,
        "realtime_dly": 500,
        "realtime_post_perm": false,
        "rot": "",
        "roi": "",
        "draw_track": false,
        "send_track": 0,
        "min_face_size": 0,
        "max_face_size": 0,
        "overall": true,
        "only_norm": false,
        "max_candidates": 0,
        "jpeg_quality": 95,
        "ffmpeg_format": ""
      },
      "stream_settings_gpu": {
        "play_speed": -1,
        "filter_min_quality": 0.45,
        "filter_min_face_size": 1,
        "filter_max_face_size": 8192,
        "normalized_only": false,
        "jpeg_quality": 95,
        "overall_only": false,
        "use_stream_timestamp": false,
        "ffmpeg_params": [],
        "router_timeout_ms": 15000,
        "router_verify_ssl": true,
        "router_headers": [
          "Authorization=Token 7db297c4107518b52b4e2195b72c5947"
        ],
        "router_body": [],
        "start_stream_timestamp": 0,
        "imotion_threshold": 0,
        "rot": "",
        "roi": "",
        "realtime_post_interval": 1,
        "realtime_post_every_interval": false,
        "ffmpeg_format": "",
        "disable_drops": true,
        "router_full_frame_png": false,
        "router_disable_normalized": false,
        "crop_fullframe_rot": false,
        "realtime_post_first_immediately": false
      },
      "status": "INPROGRESS",
      "status_msg": "",
      "statistic": {
        "processed_duration": 291,
        "faces_posted": 335,
        "faces_failed": 0,
        "faces_not_posted": 0,
        "processing_fps": 359.69928,
        "frames_dropped": 0,
        "frames_processed": 8731,
        "frames_imotion_skipped": 0,
        "decoding_soft_errors": 0,
        "frame_width": 1280,
        "frame_height": 720,
        "job_starts": 1
      },
      "restream_url": "ws://127.0.0.1:18999/stream/ffsec-video-archive:1",
      "shots_url": "http://127.0.0.1:18999/shot/ffsec-video-archive:1",
      "worker_id": "tevmenova-ntechlab_gpu_2a1fd5290195670b689d8e01e93b673c",
      "version": "bt1tm3bm51nv2hqc4qh0"
    

Each job has the following parameters:

  • id: job id.
  • enabled: active status.
  • stream_url: URL/address of video stream/file to process.
  • labels: tag(s) that will be used by the findface-facerouter component (findface-security in the standard FindFace Security configuration) to find processing directives for faces detected in this stream.
  • single_pass: if true, disable restarting video processing upon error (by default, false).
  • router_url: IP address and port of the findface-facerouter component (findface-security in the standard FindFace Security configuration) to receive detected faces from the findface-video-worker component for processing.
  • stream_settings: used only for backward compatibility.
  • stream_settings_gpu: video stream settings that duplicate those in the findface-video-manager configuration file (while having priority over them).
  • status: job status.
  • status_msg: additional job status info.
  • statistic: job progress statistics (progress duration, number of posted and not posted faces, processing fps, the number of processed and dropped frames, job start time, etc.).
  • worker_id: id of the findface-video-worker instance executing the job.