Ok - the use case here is car detection at at gate. I have to fire the detection multiple times sometimes for it to recognize something as simple as a car, even though I have played with confidence levels all over the place. 75-80% seems about where it needs to be to not just show the entire frame as being detected as a “car”… so, that means that the delays stack up every time I fire the event. Firing it 3 times can take over 15 seconds, or longer. I might as well get out of the car and punch in the numbers on the keypad to open the gate!
When a REAL car appears, it’s 95.3% sure it’s a car. Whew!
So obviously it’s not a critical use case, but there is something going on Deep inside causing processing delays… and it’s not my Pi being overloaded. Glances shows overall 27-30% CPU usage pretty much at all times.
Here’s me sending the curl -X trigger from my Mac to the Coral Pi rest server in succession:
~/Downloads/:> curl -X POST -F [email protected] 'http://192.168.1.208:5000/v1/vision/detection'
{"predictions":[{"confidence":0.58203125,"label":"car",
"x_max":2688,"x_min":25,"y_max":1520,"y_min":36}],"success":true}
~/Downloads/:> curl -X POST -F [email protected] 'http://192.168.1.208:5000/v1/vision/detection'
{"predictions":[{"confidence":0.58203125,"label":"car",
"x_max":2688,"x_min":25,"y_max":1520,"y_min":36}],"success":true}
~/Downloads/:> curl -X POST -F [email protected] 'http://192.168.1.208:5000/v1/vision/detection'
{"predictions":[{"confidence":0.58203125,"label":"car",
"x_max":2688,"x_min":25,"y_max":1520,"y_min":36}],"success":true}
Interesting that it thinks my empty driveway jpg I submit is consistently identified as a “car” with 58.20% confidence each time I submit it (could it be the shadows/sun outline?) Hence my need for a number greater than this for confidence levels so I eliminate false positives.
And the resulting log:
2020-05-13 09:01:56,722 INFO werkzeug Thread-17325 : 192.168.1.200 - - [13/May/2020 09:01:56] "POST /v1/vision/detection HTTP/1.1" 200 -
2020-05-13 09:01:57,638 INFO werkzeug Thread-17326 : 192.168.1.200 - - [13/May/2020 09:01:57] "POST /v1/vision/detection HTTP/1.1" 200 -
2020-05-13 09:01:58,880 INFO werkzeug Thread-17327 : 192.168.1.200 - - [13/May/2020 09:01:58] "POST /v1/vision/detection HTTP/1.1" 200 -
2020-05-13 09:02:00,017 INFO werkzeug Thread-17328 : 192.168.1.200 - - [13/May/2020 09:02:00] "POST /v1/vision/detection HTTP/1.1" 200 -
2020-05-13 09:02:01,071 INFO werkzeug Thread-17329 : 192.168.1.200 - - [13/May/2020 09:02:01] "POST /v1/vision/detection HTTP/1.1" 200 -
as you can see from the timestamps, there is no delay, and I’m sending the 1MB image above for processing.
The good that comes from investigating all of this is my “new” deep understanding of this component and how it all works together! Not time wasted at all… Jeff