
    >|h                     b    d dl Z d dlZd dlZd dlmZ  ed      ZdefdZdefdZ	de
de
fd	Zy)
    N)Loggerzcommons.package_utils)modulereturnc                  \    t        t        j                  j                  dd      d         S )zQ
    Find tensorflow's major version
    Returns
        major_version (int)
    .   maxsplitr   inttf__version__split     ]/var/www/html/test/engine/venv/lib/python3.12/site-packages/deepface/commons/package_utils.pyget_tf_major_versionr      s(     r~~##C!#4Q788r   c                  \    t        t        j                  j                  dd      d         S )zQ
    Find tensorflow's minor version
    Returns
        minor_version (int)
    r   r	   r   r   r   r   r   get_tf_minor_versionr      s(     r~~##C"#5a899r   	file_pathc                    t        j                  |       }|j                  }|j                  }|j                  }| d| d| }t        j                         }|j                  |j                  d             |j                         S )z
    Find the hash of given image file with its properties
        finding the hash of image content is costly operation
    Args:
        file_path (str): exact image path
    Returns:
        hash (str): digest with sha1 algorithm
    -zutf-8)
osstatst_sizest_ctimest_mtimehashlibsha1updateencode	hexdigest)r   
file_stats	file_sizecreation_timemodification_time
propertieshashers          r   find_hash_of_filer*       s     #J ""I''M"++;aa0A/BCJ\\^F
MM*##G,-r   )r   r   
tensorflowr   deepface.commons.loggerr   loggerr   r   r   strr*   r   r   r   <module>r/      sK    	   +	.	/9c 9:c :  r   