
    6Fi                     D    d dl Z d dlZd dlZd dlmZ  G d d          ZdS )    N)DeepFacec                       e Zd Zd ZddZdS )
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      >D:\xampp\htdocs\new-grp\engine\services\proctor\fraud_check.pydecode_base64_imagezfraudCheck.decode_base64_image   s:    %j11
z2844|FC$4555          ?c                 H   	 t                               |           }t                               |          }t          j        ||d          }|d         }|d         }||k    }|||dS # t          $ r.}	t          d|	           t          |	          dd d dcY d }	~	S d }	~	ww xY w)NF)enforce_detectiondistance	threshold)verifiedr   r   u   ❌ Face match failed:)errorr   r   r   )r   r   r   verify	Exceptionprintstr)
id_image_b64
selfie_b64custom_thresholdid_img
selfie_imgresultr   r   r   es
             r   match_faceszfraudCheck.match_faces   s    	33LAAF#77
CCJ_VZ5QQQFj)H{+I#33H %$-    	 	 	*A...Q! !	       	s   A&A) )
B!3#BB!B!N)r   )__name__
__module____qualname__r   r'    r   r   r   r      s7        6 6 6
     r   r   )r   r   numpyr	   deepfacer   r   r+   r   r   <module>r.      sg     



                   r   