microsoft / Cognitive-Samples-IntelligentKiosk

Welcome to the Intelligent Kiosk Sample! Here you will find several demos showcasing workflows and experiences built on top of the Microsoft Cognitive Services.
https://www.microsoft.com/cognitive-services
Other
1.05k stars 579 forks source link

Please update Kiosk Code as per issue #315 #49

Closed rrvenki closed 5 years ago

rrvenki commented 5 years ago

Please address the issue reported in [https://github.com/MicrosoftDocs/winrt-api/issues/315] in the code of "CameraControl". It helps in raising event when there is change in number of human faces in the vicinity without making a server round trip and also without having a race condition between thread pool and face processing thread. Adding the code recommended by @drewbatgit and the development team is a necessity.

CarlosP-MS commented 5 years ago

I am not sure using the event pattern would change the number of calls to the cloud. In a demo such as Realtime Crowd Insights, when the Windows face tracker says that there are no faces present in a frame (whether that is correct or just a side effect of the timing of the two threads), we will simply skip the call to Cognitive Services for that frame. We only call when it says that there are faces in the frame, so that we can get attributes about those faces such as age, gender, emotion, etc, and present them in the UI.

rrvenki commented 5 years ago

"... if your polling thread is running faster than the face detection thread. In particular, if your thread is twice as fast as the capture rate, it will cause the alternating counts you are seeing."

Given this scenario in the Kiosk code, I requested to update it to address the scenario of "polling thread running faster than the face detection thread". Request you to please read the change implemented in "CameraFaceDetection" by the development team explained at https://github.com/MicrosoftDocs/winrt-api/issues/315.

As you have explained above to skip the call to Cognitive Services for that frame, it does not work. In this case the Polling thread is actually twice as fast as Face detection thread and hence the face detected will be zero inspite of having greater than 0.