
    Z|h                     <    d dl Z d dlZd dlZd dlmZ  G d d      Zy)    N)DeepFacec                       e Zd Zd Zd Zy)
fraudCheckc                     t        j                  |       }t        j                  |t        j                        }t        j                  |t
        j                        S )N)base64	b64decodenp
frombufferuint8cv2imdecodeIMREAD_COLOR)
b64_string
image_datanp_arrs      >E:\xampp\htdocs\new-grp\engine\services\proctor\fraud_check.pydecode_base64_imagezfraudCheck.decode_base64_image   s=    %%j1
z2884||FC$4$455    c                 
   	 t         j                  |       }t         j                  |      }t        j                  ||d      }|d   |d   |d   dS # t        $ r&}t        d|       t        |      dd d dcY d }~S d }~ww xY w)	NF)enforce_detectionverifieddistance	threshold)r   r   r   u   ❌ Face match failed:)errorr   r   r   )r   r   r   verify	Exceptionprintstr)id_image_b64
selfie_b64id_img
selfie_imgresultes         r   match_faceszfraudCheck.match_faces   s    	33LAF#77
CJ__VZ5QF":.":.#K0   	*A.Q! !	 	s   AA 	BA=7B=BN)__name__
__module____qualname__r   r%    r   r   r   r      s    6
r   r   )r   r   numpyr	   deepfacer   r   r)   r   r   <module>r,      s     
   r   