
    I/Yh;	                     J   d dl mZ d dlZd dlZd dlZd dlmZ d dlZd dl	Z	d dl
Z
d Zd Zd Zd Z ej                     ej        d           ej        dd	d
           ej        ddd          d                                                 Zedk    r e             dS dS )    )print_functionNc           	      `    |\  }}}}t          d                    | ||||                     d S )Nz{},{},{},{},{})printformat)filenamelocationtoprightbottomlefts         kD:\DownLoads\facial_attendance_system-main\venv311\Lib\site-packages\face_recognition/face_detection_cli.pyprint_resultr      s;    'C	

!
!(C
E
EFFFFF    c                     t          j        |           }t          j        |d|          }|D ]}t          | |           d S )Nr   )number_of_times_to_upsamplemodel)face_recognitionload_image_fileface_locationsr   )image_to_checkr   unknown_imager   face_locations        r   
test_imager      sW    $4^DDM%4]`ainoooN' 4 4^]33334 4r   c                 D      fdt          j                   D             S )Nc                     g | ]C}t          j        d |t           j                  #t          j                            |          DS )z.*\.(jpg|jpeg|png))flags)rematchIospathjoin).0ffolders     r   
<listcomp>z)image_files_in_folder.<locals>.<listcomp>   sE    rrr28LacdlnlpCqCqCqrBGLL##rrrr   )r    listdir)r%   s   `r   image_files_in_folderr(      s'    rrrrRZ-?-?rrrrr   c                 "   |dk    rd }n|}t           }dt          j                    v rt          j        d          }|                    |          }t	          | t          j        |                    }|                    t          |           d S )N
forkserver)	processes)	multiprocessingget_all_start_methodsget_contextPoolzip	itertoolsrepeatstarmapr   )images_to_checknumber_of_cpusr   r,   contextpoolfunction_parameterss          r   process_images_in_process_poolr:      s    		"	 G<>>>>!-l;;<<)<,,D 
 	LL011111r   r   z--cpus   zDnumber of CPU cores to use in parallel. -1 means "use all in system")defaulthelpz--modelhogz>Which face detection model to use. Options are "hog" or "cnn".c                 D   t           j        dk     r|dk    rt          j        d           d}t          j                            |           rC|dk    rfdt          |           D              d S t          t          |           |           d S t          |            d S )N)      r;   zmWARNING: Multi-processing support requires Python 3.4 or greater. Falling back to single-threaded processing!c                 0    g | ]}t          |          S  )r   )r#   
image_filer   s     r   r&   zmain.<locals>.<listcomp>>   s#    ccczZ
E**cccr   )
sysversion_infoclickechor    r!   isdirr(   r:   r   )r   cpusr   s     `r   mainrK   2   s     	6!!tqyy
  C  	D  	D  	D	w}}^$$ *199cccc=RSa=b=bcccccc*+@+P+PRVX]^^^^^>5)))))r   __main__)
__future__r   rG   r    r   face_recognition.apiapir   r-   rE   r2   r   r   r(   r:   commandargumentoptionrK   __name__rC   r   r   <module>rT      sF   % % % % % %  				 				 / / / / / /     



    G G G
4 4 4s s s2 2 2*  !!h(noooi-mnnn* * on po "! * zDFFFFF r   