
    h4                    B    S SK Jr  S SKrS SKrS SKJr   " S S\5      rg)    )annotationsN)OpRunc                  "    \ rS rSrSSS jjrSrg)ImageDecoder   c                    SS K nUR                  R                  [        R
                  " UR                  5       5      5      nUS:X  a&  [        R                  " U5      S S 2S S 2S S S24   nU4$ US:X  a  [        R                  " U5      nU4$ US:X  a?  UR                  S5      n[        R                  " U5      n[        R                  " USS	9nU4$ [        S
U< S35      e! [         a  n[        S5      UeS nAff = f)Nr   zYPillow must be installed to use the reference implementation of the ImageDecoder operatorBGRRGB	GrayscaleL   )axiszpixel_format=z is not supported.)	PIL.ImageImportErrorImageopenioBytesIOtobytesnparrayconvertexpand_dims
ValueError)selfencodedpixel_formatPILeimgdecodeds          ]/var/www/fran/franai/venv/lib/python3.13/site-packages/onnx/reference/ops/op_image_decoder.py_runImageDecoder._run   s    	
 iinnRZZ(9:;5 hhsmAq$B$J/G z U"hhsmG z [(++c"ChhsmGnnW15G z }\,<<NOPP  	k	s   C# #
C>-C99C> N)r   )r   z
np.ndarrayreturnztuple[np.ndarray])__name__
__module____qualname____firstlineno__r$   __static_attributes__r&       r#   r   r      s     r-   r   )
__future__r   r   numpyr   onnx.reference.op_runr   r   r&   r-   r#   <module>r1      s   
 # 	  '5 r-   