skrashevich / double-take

Unified UI and API for processing and training images for facial recognition.
https://hub.docker.com/r/skrashevich/double-take
MIT License
536 stars 26 forks source link

TypeError: MQTT: recognize error: Cannot read properties of undefined (reading 'DEVICE_TRACKER_TIMEOUT') #613

Open semikor opened 6 days ago

semikor commented 6 days ago

Hello! Thank you so much for your hard work!

Describe the bug The notification does not work when recognition is successful. mqtt matches: double-take/matches does not work.

Version of Double Take v1.13.11.8

Expected behavior Get the fact of successful recognition and the name in Node-Red (mqtt matches: double-take/matches).

Screenshots

24-11-20 18:52:14 info: processing camera2: 3e9ae69f-a6e3-476c-9d2f-ff831617dbdc
24-11-20 18:52:14 info: done processing camera2: 3e9ae69f-a6e3-476c-9d2f-ff831617dbdc in 0.17 sec
24-11-20 18:52:14 info: {
  id: '3e9ae69f-a6e3-476c-9d2f-ff831617dbdc',
  duration: 0.17,
  timestamp: '2024-11-20 18:52:14',
  attempts: 1,
  camera: 'camera2',
  zones: [],
  counts: { person: 1, match: 1, miss: 0, unknown: 0 },
  matches: [
    {
      name: 'Hello',
      confidence: 99.22,
      match: true,
      box: [Object],
      type: 'manual',
      duration: 0.15,
      detector: 'compreface',
      filename: '395aaf12-694d-4c77-89c5-229d9f637a91.jpg'
    }
  ],
  misses: [],
  unknowns: []
}
24-11-20 18:52:14 error: TypeError: MQTT: recognize error: Cannot read properties of undefined (reading 'DEVICE_TRACKER_TIMEOUT')
    at /double-take/api/src/util/mqtt.util.js:278:32
    at Array.forEach (<anonymous>)
    at module.exports.recognize (/double-take/api/src/util/mqtt.util.js:239:13)
    at module.exports.start (/double-take/api/src/controllers/recognize.controller.js:184:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Hardware

Configuration

# Double Take
# Learn more at https://github.com/skrashevich/double-take/#configuration
# enable mqtt subscribing and publishing (default: shown below)
mqtt:
  host: 192.168.1.81
  port: 1883
  username: user
  password: pass
  #client_id:

  topics:
    # mqtt topic for frigate message subscription
    #frigate: frigate/events
    #  mqtt topic for home assistant discovery subscription
    homeassistant: homeassistant
    # mqtt topic where matches are published by name
    matches: double-take/matches
    # mqtt topic where matches are published by camera name
    cameras: double-take/cameras

home_assistant:
  url: http://192.168.1.84:8123
  token:  xxxxx

# detector settings (default: shown below)
detectors:
  compreface:
    url: http://192.168.1.88:8888
    # recognition api key
    key: xxxxx
    # number of seconds before the request times out and is aborted
    timeout: 15
    # minimum required confidence that a recognized face is actually a face
    # value is between 0.0 and 1.0
    det_prob_threshold: 0.8
    # require opencv to find a face before processing with detector
    opencv_face_required: false
    # comma-separated slugs of face plugins
    # https://github.com/exadel-inc/CompreFace/blob/master/docs/Face-services-and-plugins.md)
    # face_plugins: mask,gender,age
    # only process images from specific cameras, if omitted then all cameras will be processed
  #  cameras:
  #    - Door
  #    - Camera2
  #    - Camera3
  #    - Camera4
telemetry: false

# global detect settings (default: shown below)
detect:
  match:
    # save match images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed to consider a result a match
    confidence: 93
    # hours to keep match images until they are deleted
    purge: 720
    # minimum area in pixels to consider a result a match
    min_area: 12000
#    width: 500

  unknown:
    # save unknown images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed before classifying a name as unknown
    confidence: 50
    # hours to keep unknown images until they are deleted
    purge: 720
    # minimum area in pixels to keep an unknown result
    min_area: 5000
  #    width: 500

notify:
  telegram:
  # Node-RED
    token: xxxxxx
    chat_id: "xxxxxx"

Additional context There are notifications in Telegram and on the web. mqtt matches: double-take/matches does not work. Double-Take works without Frigate. I am sending photos for recognition from Node-Red via the REST API "http://192.168.1.88:3000/api/recognize?url=http://login:hfssword@" + foto + "&attempts=1&camera=camera2"

Please help me solve the problem!

v1.13.11.8