+
    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# )U2netSessionzL
This class represents a U2net session, which is a subclass of BaseSession.
c                6   < V ^8  d   QhRS[ RS[S[ ,          /# )   imgreturn)PILImager   )format__classdict__s   "R/var/www/html/photoedit/myenv/lib/python3.14/site-packages/rembg/sessions/u2net.py__annotate__U2netSession.__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                  ^ ^4      ^,          P                  R4      RR7      pVP                  VP                  \        P                  P                  4      pV.# )	a
  
Predicts the output masks for the input image using the inner session.

Parameters:
    img (PILImage): The input image.
    *args: Additional positional arguments.
    **kwargs: Additional keyword arguments.

Returns:
    List[PILImage]: The list of output 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clipastyperesizesize
ResamplingLANCZOS)	selfr
   argskwargsort_outspredmamimasks	   &&*,     r   predictU2netSession.predict   s     %%))NN*,A:
 {:&VVD\VVD\	bg&zz$		!Q# 5==gFSQ{{388U%5%5%=%=>vr   c           
        V P                   ! V/ VB  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      # )z
Downloads the U2net model file from a specific URL and saves it.

Parameters:
    *args: Additional positional arguments.
    **kwargs: Additional keyword arguments.

Returns:
    str: The path to the downloaded model file.
z.onnxzHhttps://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnxNz$md5:60024c5c889badc19c04ad937298a77bT)fnamepathprogressbar)namepoochretrievechecksum_disabled
u2net_homeosr3   join)clsr(   r)   r2   s   &*, r   download_modelsU2netSession.download_models1   s     88T,V,-U3V (($9&99 ;00
	
 ww||CNND;F;UCCr   c                    R# )z
Returns the name of the U2net session.

Parameters:
    *args: Additional positional arguments.
    **kwargs: Additional keyword arguments.

Returns:
    str: The name of the session.
u2net )r<   r(   r)   s   &*,r   r5   U2netSession.nameL   s     r   rA   N)__name__
__module____qualname____firstlineno____doc__r/   classmethodr=   r5   __static_attributes____classdictcell__)r   s   @r   r   r      s?      @ D D4  r   r   )r:   typingr   numpyr   r6   PILr   	PIL.Imager   baser   r   rA   r   r   <module>rP      s(    	     ' L; Lr   