4.4. In order to make the face detection algorithm work in real time and perform calculations for both speech recognition and face detection on the device, the author optimized the system to run the face detection algorithm only when speech is detected and only when a previous frame is not already being analyzed for a face since the detection algorithm runs slower than the video feed. In this way, the final system is not overloaded with heavy calculations. The system built assumes the following conditions and limitations