Closed jbolanosg closed 3 years ago
Are you referring to activateRegions
regions for triggers?
if that's what I'm referring to ... according to the definition of regions:
What I'm asking you to analyze is to modify the overlaps method in the source code so that it works with the centroid of the detected object.
Changing the way they work would be a breaking change and cause issues for anyone who has already deployed the system and uses it. As implemented and documented it's designed to trigger on any overlap.
What scenario are you dealing with where you need to use activateRegions
? It's a relatively recent addition that is really only useful in limited circumstances.
For example, the camera on the balcony watches over my car and watches that a person does not approach the car ... that's why I configure two regions, one (upper region in green) that only checks a car in the area and the lower one ( region in green) that checks that there are people near the street near the car.
With this separation I can know when my car is parked and when a person could approach it. Another use case is a camera that can see various sectors of the house (living room, hallway and kitchen) and depending on where the camera detects the person could turn on the lights in the living room or the kitchen. I attach real photos of example ... I do this from the home assistant side where I add the box in yellow where the object was detected and in green the area where its centroid was ... in this development in python integrate the requirements that I have asked you for your program:
I did this development while I wait for them to maybe be integrated into your system.
Photos:
Closing old issues.
In the tests that I am reviewing it is happening to me many times that it says that a prediction is successful if the box of the same only touches the area defined for success .... reviewing the source code I find that you define that a prediction is successful if it has overlap .... see code in: https://github.com/danecreekphotography/node-deepstackai-trigger/blob/189132b4f13902306979dce0807b045850255d0f/src/Rect.ts#L20
It is more effective to use that the centroid of the prediction box is inside the activateRegions. This is more real to verify that an object is within a region. In the HASS-Deepstack-object component that has home assistant that uses Deepstack AI this is the method they use ... See code: https://github.com/robmarkcole/HASS-Deepstack-object/blob/f72a02f886af96938082f58032933a36ee2846eb/custom_components/deepstack_object/image_processing.py#L116
With this change, the report made by node-deepstack-trigger of a successful prediction would have more reliability.