a
    d                     @   s   d dl Z d dlZdddZdS )    NFc              	   C   sF  t | } |rt| tj} |D ]}t| |d dt|d t|d d ftjdd tt	t|}t
| |d |d f|d |d	 fd
d t| |d |d fdd
d t| |d |d fddd t| |d |d fddd t| |d |d fddd t| |d |d fddd q |durBt||  dS )zoVisualize detection results.

    Args:
        img (Numpy array): Input image. CHW, BGR, [0, 255], uint8.
       z.4fr         g      ?)   r   r         )r   r   r               )r   r   r   	   
   )r   r   r      )r   r   r         )r   r   r   N)npcopycv2ZcvtColorZCOLOR_RGB2BGRZputTextintZFONT_HERSHEY_DUPLEXlistmapZ	rectangleZcircleZimwrite)imgZbboxes_and_landmarksZ	save_pathZto_bgrb r   m/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/facexlib/visualization/vis_detection.pyvisualize_detection   s    

6* 
r   )NF)r   numpyr   r   r   r   r   r   <module>   s   