angadsingh / argos

a spacial-temporal pattern detection system for home automation
135 stars 12 forks source link

Use as generic person detection? #8

Closed edalquist closed 3 years ago

edalquist commented 3 years ago

I'm playing around with using argos as generic person detection. Can I just comment out all the door related options?

angadsingh commented 3 years ago

you can disable pattern detection completely by setting config.pattern_detection_enabled to False in your config

then you will have argos only do (motion detection filtered) object detection, and notify (via MQTT/webhook) when objects are found.

make it person-only detection by setting config.tf_detection_labels to ['person']

FWIW you dont need to limit it to "person". it can detect 90 classes of objects: https://github.com/tensorflow/models/blob/master/research/object_detection/data/mscoco_label_map.pbtxt

if you have a fast enough device with a GPU (or have coral accelerator), then you don't even need to apply the motion detection filter for object detection. just disable that by setting config.tf_apply_md to False. then you get pure object detection on every frame.

edalquist commented 3 years ago

EDIT: Reported in new issue: https://github.com/angadsingh/argos/issues/9

At fe0da14 when I set pattern_detection_enabled to False I get:

$ python stream.py --ip 0.0.0.0 --port 8080 --config configs.driveway_stream
2021-02-13 14:45:31:INFO:__main__:package import START
\2021-02-13 14:45:31:INFO:__main__:package import END
Traceback (most recent call last):
  File "stream.py", line 241, in <module>
    sd = StreamDetector(config, od, pattern_detector)
  File "stream.py", line 54, in __init__
    self.door_state_manager = DoorStateManager(pattern_detector, pattern_detector.broker_q)
AttributeError: 'NoneType' object has no attribute 'broker_q'

It looks like pattern_detection_enabled=False results in pattern_detector being set to None but that isn't handled in the door and motion state handler init:

        self.door_state_manager = DoorStateManager(pattern_detector, pattern_detector.broker_q)
        self.motion_state_manager = MotionStateManager(pattern_detector, pattern_detector.broker_q)
angadsingh commented 3 years ago

thanks for the reporting the issue. i released the fix.