Face recognition is used extensively in authentication systems because it offers contactless and fast use. Face liveness detection algorithms have become of vital importance, especially with its widespread use in important areas such as banking and digital wallets. In this study, a real-time liveness detection method that can be applied to face recognition systems is proposed. The method detects faces in two images taken simultaneously with stereo imaging and extracts landmarks from the detected faces. A sparse 3D face model is created with the help of stereo calibration matrices obtained from these points and cameras. Using a deep learning architecture trained with the created 3D face models, the input images are classified whether they belong to an actual face or a photograph. In this way, deception of the face recognition based authentication system is prevented. According to the quantitative test results obtained, it has been shown that the proposed algorithm is much more successful against photo deception compared to existing methods. The method achieved an accuracy of up to 99% in experiments performed on the expanded version of the EPFL Stereo Face Dataset.