
    ^j
                     h    d Z ddlmZmZ ddlmZ ddlmZ  G d de      Zd
dZ	e
d	k(  r e	        yy)af  LightningCLI entry point for RF-DETR training and evaluation.

Provides the ``rfdetr`` command with auto-generated subcommands::

    rfdetr fit     --config configs/rfdetr_base.yaml
    rfdetr validate --ckpt_path output/best.ckpt
    rfdetr test    --ckpt_path output/best.ckpt
    rfdetr predict --ckpt_path output/best.ckpt

Both ``RFDETRModelModule`` and ``RFDETRDataModule`` share the same ``(model_config, train_config)`` constructor
signature.  ``link_arguments`` eliminates the duplication so the user specifies each config group once; the datamodule
receives the same values automatically at parse time.
    )LightningArgumentParserLightningCLI)RFDETRDataModule)RFDETRModelModulec                        e Zd ZdZdeddfdZy)	RFDETRCliam  LightningCLI subclass for RF-DETR training and evaluation.

    Wires ``RFDETRModelModule`` and ``RFDETRDataModule`` under a unified CLI, with argument linking that shares
    ``model_config`` and ``train_config`` between module and datamodule so the user only specifies them once.

    Auto-generated subcommands: ``fit``, ``validate``, ``test``, ``predict``.
    parserreturnNc                 T    |j                  ddd       |j                  ddd       y)u  Register argument links that share configs between module and datamodule.

        Linking ``model.model_config`` → ``data.model_config`` and ``model.train_config`` → ``data.train_config`` means
        the user specifies both config groups once; the datamodule receives the same values automatically.

        Args:
            parser: The jsonargparse ``LightningArgumentParser`` provided by
                ``LightningCLI``.
        zmodel.model_configzdata.model_configparse)apply_onzmodel.train_configzdata.train_configN)link_arguments)selfr	   s     ^/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/rfdetr/training/cli.pyadd_arguments_to_parserz!RFDETRCli.add_arguments_to_parser#   s4     	24GRYZ24GRYZ    )__name__
__module____qualname____doc__r   r    r   r   r   r      s    [.E [$ [r   r   Nc                  ,    t        t        t               y)zEntry point for the ``rfdetr`` CLI.

    Constructs and runs ``RFDETRCli`` with ``RFDETRModelModule`` and ``RFDETRDataModule``.  Subcommands are auto-
    generated by ``LightningCLI``: ``fit``, ``validate``, ``test``, ``predict``.
    N)r   r   r   r   r   r   mainr   1   s     !12r   __main__)r
   N)r   pytorch_lightning.clir   r   rfdetr.training.module_datar   rfdetr.training.module_modelr   r   r   r   r   r   r   <module>r      s=    H 8 :[ [.3 zF r   