+
    Ciu	                     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# )U2netHumanSegSessionzZ
This class represents a session for performing human segmentation using the U2Net model.
c                6   < V ^8  d   QhRS[ RS[S[ ,          /# )   imgreturn)PILImager   )format__classdict__s   "\/var/www/html/photoedit/myenv/lib/python3.14/site-packages/rembg/sessions/u2net_human_seg.py__annotate__!U2netHumanSegSession.__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 human segmentation masks for the input image.

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

Returns:
    List[PILImage]: A list of predicted 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U2netHumanSegSession.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      # )z
Downloads the U2Net model weights.

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

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

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

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