
    3j                        S SK Jr  S SKJrJrJr  S SKJr  SSKJ	r	  SSK
Jr   " S S\R                  \	\5      r " S	 S
\R                  \	\5      rg)    )annotations)AnyLiteralOptional)nn   )ImageModuleMixIn)ONNXExportMixinc                     ^  \ rS rSrSrSU 4S jjr\SS j5       r\R                  SSS jj5       rSSS.         SU 4S	 jjjr	S
r
U =r$ )ImageModule   av  Handles image-based operations.

This modules accepts multiple input and output data types, provides end-to-end
visualization, file saving features. Note that this module fits the classes that
return one image tensor only.

Note:
    The additional add-on features increase the use of memories. To restore the
    original behaviour, you may set `disable_features = True`.

c                4   > [         TU ]  " U0 UD6  SU l        g NFsuper__init___disable_featuresselfargskwargs	__class__s      L/home/wildlama/miniconda3/lib/python3.13/site-packages/kornia/core/module.pyr   ImageModule.__init__)       $)&)',    c                    U R                   $ )a  Whether convenience I/O (input/output) helper features are disabled.

This flag controls the extra behavior provided by :class:`ImageModuleMixIn`,
such as automatic input conversion (for example, PIL or NumPy inputs),
automatic output conversion, and output caching for visualization helpers.

Returns:
    ``True`` if the helper features are bypassed and the module behaves like
    a plain :class:`torch.nn.Module` call. ``False`` if helper features are enabled.
r   r   s    r   disable_featuresImageModule.disable_features-        %%%r   c                    Xl         g)a)  Enable or disable convenience I/O (input/output) handling features.

Args:
    value: Feature toggle.
        - ``True``: disable automatic type conversion and output caching,
          so ``__call__`` behaves closer to a raw PyTorch module call.
        - ``False``: keep helper features active.
Nr   r   values     r   r    r!   ;   
     "'r   Nptinput_names_to_handleoutput_typec                  > U R                   (       dL  U R                  XS9" [        TU ]  5      nU" U0 UD6nUS:X  a  U R	                  U5      U l        U$ X`l         U$ [        TU ]  " U0 UD6nU$ ao  Overwrite the __call__ function to handle various inputs.

Args:
    inputs: Inputs to operate on.
    input_names_to_handle: List of input names to convert, if None, handle all inputs.
    output_type: Desired output type ('pt', 'numpy', or 'pil').
    kwargs: Additional arguments.

Returns:
    Callable: Decorated function with converted input and output types.

r(   r'   r   convert_input_outputr   __call___detach_tensor_to_cpu_output_imager   r)   r*   inputsr   decorated_forwardr1   r   s          r   r/   ImageModule.__call__G       ( %% $ 9 9&; !: !g!  .v@@Md"%)%?%?%N"
  &3"  "G,f??Mr   r   r1   r   r   r   r   returnNoner9   boolTr%   r<   r9   r:   
r3   r   r)   zOptional[list[Any]]r*   zLiteral['pt', 'numpy', 'pil']r   r   r9   r   __name__
__module____qualname____firstlineno____doc__r   propertyr    setterr/   __static_attributes____classcell__r   s   @r   r   r      }    
- & & 	' 	' 6:59	  3 3	
  
 r   r   c                     ^  \ rS rSrSrSU 4S jjr\SS j5       r\R                  SSS jj5       rSSS.         SU 4S	 jjjr	S
r
U =r$ )ImageSequentiali   a  Handles image-based operations as a sequential module.

This modules accepts multiple input and output data types, provides end-to-end
visualization, file saving features. Note that this module fits the classes that
return one image tensor only.

Note:
    The additional add-on features increase the use of memories. To restore the
    original behaviour, you may set `disable_features = True`.

c                4   > [         TU ]  " U0 UD6  SU l        g r   r   r   s      r   r   ImageSequential.__init__v   r   r   c                    U R                   $ )a  Whether convenience I/O (input/output) helper features are disabled.

This flag controls the extra behavior provided by :class:`ImageModuleMixIn`,
such as automatic input conversion (for example, PIL or NumPy inputs),
automatic output conversion, and output caching for visualization helpers.

Returns:
    ``True`` if the helper features are bypassed and the module behaves like
    a plain :class:`torch.nn.Sequential` call. ``False`` if helper features are enabled.
r   r   s    r   r     ImageSequential.disable_featuresz   r"   r   c                    Xl         g)a-  Enable or disable convenience I/O (input/output) handling features.

Args:
    value: Feature toggle.
        - ``True``: disable automatic type conversion and output caching,
          so ``__call__`` behaves closer to a raw PyTorch sequential call.
        - ``False``: keep helper features active.
Nr   r$   s     r   r    rR      r&   r   Nr'   r(   c                  > U R                   (       dL  U R                  XS9" [        TU ]  5      nU" U0 UD6nUS:X  a  U R	                  U5      U l        U$ X`l         U$ [        TU ]  " U0 UD6nU$ r,   r-   r2   s          r   r/   ImageSequential.__call__   r6   r   r7   r8   r;   r=   r>   r?   r@   rJ   s   @r   rM   rM   i   rK   r   rM   N)
__future__r   typingr   r   r   torchr   mixin.image_moduler	   
mixin.onnxr
   Moduler   
SequentialrM    r   r   <module>r^      sH   $ # ) )  0 'J"))- JZJbmm%5 Jr   