+
    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# )U2netpSessionz;This class represents a session for using the U2netp model.c                6   < V ^8  d   QhRS[ RS[S[ ,          /# )   imgreturn)PILImager   )format__classdict__s   "S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/rembg/sessions/u2netp.py__annotate__U2netpSession.__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.# )	z
Predicts the mask for the given image using the U2netp model.

Parameters:
    img (PILImage): The input image.

Returns:
    List[PILImage]: The predicted mask.
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U2netpSession.predict   s     %%))NN*,A:
 {:&VVD\VVD\	bg&zz$s
227;#F{{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      # )zR
Downloads the U2netp model.

Returns:
    str: The path to the downloaded model.
z.onnxzIhttps://github.com/danielgatis/rembg/releases/download/v0.0.0/u2netp.onnxNz$md5:8e83ca70e441ab06c318d82300c84806T)fnamepathprogressbar)namepoochretrievechecksum_disabled
u2net_homeosr2   join)clsr'   r(   r1   s   &*, r   download_modelsU2netpSession.download_models-   s     88T,V,-U3W (($9&99 ;00
	
 ww||CNND;F;UCCr   c                    R# )zQ
Returns the name of the U2netp model.

Returns:
    str: The name of the model.
u2netp )r;   r'   r(   s   &*,r   r4   U2netpSession.nameD   s     r   r@   N)__name__
__module____qualname____firstlineno____doc__r.   classmethodr<   r4   __static_attributes____classdictcell__)r   s   @r   r   r      s<     E < D D,  r   r   )r9   typingr   numpyr   r5   PILr   	PIL.Imager   baser   r   r@   r   r   <module>rO      s(    	     ' @K @r   