You can try SELinux mode changer (rooted) to change from enforcing to permissive. The problem would probably be fixed. I've encountered the same problem many times. Hope this can help.
You have to flash v8.10.18 before install 8.1 android version. Flash v8.10.18 first, add fp then update newest version. I'm sure it will fix your problem because i solved this.
redmi 5 face unlock failed. it shows "Couldn't add face data", also i can't access the camera when i try to add face data... please fix this problem. face unlock is the best feature i like which i use EU MIUI