Facial Recognition + Database + Compare & Identify - is it complicated?
Depending on the level of accuracy/speed you want your system to have, you could try using an existing python API. First thing I found on google, the README looks adapted to your project. Otherwise ask your question with more accurate wanted specifications perhaps.