+
    Ci
                     d    ^ RI t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt	 ^RI
Ht  ! R R]4      tR# )    N)List)Image)BaseSessionc                   V   a  ] tR t^t o RtV 3R lR lt]R 4       t]R 4       tRt	V t
R# )SiluetaSessionz5This is a class representing a SiluetaSession object.c                6   < V ^8  d   QhRS[ RS[S[ ,          /# )   imgreturn)PILImager   )format__classdict__s   "T/var/www/html/photoedit/myenv/lib/python3.14/site-packages/rembg/sessions/silueta.py__annotate__SiluetaSession.__annotate__   s        8  h      c           	        V P                   P                  RV P                  VRRR4      4      pV^ ,          R,          p\        P                  ! V4      p\        P
                  ! V4      pWW,
          Wg,
          ,          p\        P                  ! V4      p\        P                  ! V^,          P                  R4      RR7      pVP                  VP                  \        P                  P                  4      pV.# )	a  
Predict the mask of the input image.

This method takes an image as input, preprocesses it, and performs a prediction to generate a mask. The generated mask is then post-processed and returned as a list of PILImage objects.

Parameters:
    img (PILImage): The input image to be processed.
    *args: Variable length argument list.
    **kwargs: Arbitrary keyword arguments.

Returns:
    List[PILImage]: A list of post-processed masks.
Nuint8L)mode)g
ףp=
?gv/?gCl?)gZd;O?gy&1?g?)@  r   )NNNr   r   r   )inner_sessionrun	normalizenpmaxminsqueezer   	fromarrayastyperesizesize
ResamplingLANCZOS)	selfr
   argskwargsort_outspredmamimasks	   &&*,     r   predictSiluetaSession.predict   s     %%))NN*,A:
 {:&VVD\VVD\	bg&zz$s
227;#F{{388U%5%5%=%=>vr   c           
        V P                  4        R2p\        P                  ! RV P                  ! V/ VB '       d   RMRVV P                  ! V/ VB RR7       \
        P                  P                  V P                  ! V/ VB V4      # )a9  
Download the pre-trained model file.

This method downloads the pre-trained model file from a specified URL. The file is saved to the U2NET home directory.

Parameters:
    *args: Variable length argument list.
    **kwargs: Arbitrary keyword arguments.

Returns:
    str: The path to the downloaded model file.
z.onnxzJhttps://github.com/danielgatis/rembg/releases/download/v0.0.0/silueta.onnxNz$md5:55e59e0d8062d2f5d013f4725ee84782T)fnamepathprogressbar)namepoochretrievechecksum_disabled
u2net_homeosr2   join)clsr'   r(   r1   s   &*, r   download_modelsSiluetaSession.download_models1   s     88:,e$X (($9&99 ;00
	
 ww||CNND;F;UCCr   c                    R# )z
Return the name of the model.

This method returns the name of the Silueta model.

Parameters:
    *args: Variable length argument list.
    **kwargs: Arbitrary keyword arguments.

Returns:
    str: The name of the model.
silueta )r;   r'   r(   s   &*,r   r4   SiluetaSession.nameN   s     r   r@   N)__name__
__module____qualname____firstlineno____doc__r.   classmethodr<   r4   __static_attributes____classdictcell__)r   s   @r   r   r      s=     ?   D D D8  r   r   )r9   typingr   numpyr   r5   PILr   	PIL.Imager   baser   r   r@   r   r   <module>rO      s(    	     ' P[ Pr   