§
    ­¸jÆ  ã            	       ó–   — d Z ddlZddlZddlmZmZ ddlmZmZ h d£Z	h d£Z
 eej        ¦  «        e
z
  Zefdeded	ed
ej        fd„ZdS )a  Package-private helper: build a self-contained namespace from Pydantic configs.

Replaces the previous shim in ``_args.py`` that called the deprecated ``populate_args()`` function from ``main.py``.
This module has zero dependency on ``main.py`` and can survive its deletion.
é    N)ÚModelConfigÚTrainConfig)ÚMODEL_DEFAULTSÚModelDefaults>&   ÚdeviceÚencoderÚ	ca_nheadsÚ	sa_nheadsÚ	two_stageÚ
dec_layersÚ
group_detrÚ
hidden_dimÚ
layer_normÚ
num_selectÚ
patch_sizeÚ
resolutionÚia_bce_lossÚnum_classesÚnum_queriesÚnum_windowsÚbbox_reparamÚdec_n_pointsÚnum_channelsÚbackbone_loraÚdual_projectorÚfreeze_encoderÚprojector_scaleÚpretrain_weightsÚsegmentation_headÚkeypoint_cross_attnÚout_feature_indexesÚlite_refpoint_refineÚmask_downsample_ratioÚnum_decoder_registersÚdual_projector_kp_onlyÚgradient_checkpointingÚinter_instance_kp_attnÚnum_keypoints_per_classÚpostprocess_trace_alphaÚuse_grouppose_keypointsÚpositional_encoding_sizeÚ grouppose_keypoint_dim_downscale>   ÚrunÚseedÚwandbÚmlflowÚresumeÚclearmlÚdevicesÚprojectÚrun_testÚstrategyÚ	num_nodesÚ	optimizerÚ
pin_memoryÚacceleratorÚclass_namesÚtensorboardÚlr_schedulerÚprogress_barÚcls_loss_coefÚoptimizer_kwargsÚdont_save_weightsÚpersistent_workersÚlr_scheduler_kwargsÚlr_scheduler_monitorÚcompute_train_metricsÚlr_scheduler_intervalÚauto_batch_ema_headroomÚauto_batch_target_effectiveÚoptimizer_param_group_overridesÚ auto_batch_max_targets_per_imageÚmodel_configÚtrain_configÚdefaultsÚreturnc                 óœ  — | }|}|}|j         }t          j        di i t          j        |¦  «        ¥|                     t          t          ¦  «        ¬¦  «        ¥|                     t          t          ¦  «        ¬¦  «        ¥t          |dd¦  «        t          |dd¦  «        t          |dd¦  «        ||j
        pd|j        �|j        nd	d
œ¥¤ŽS )aæ  Build a ``types.SimpleNamespace`` from configs and architectural defaults.

    This function is used by multiple modules as the transitional namespace
    bridge: :func:`rfdetr.models.build_model_from_config`, :func:`rfdetr.models.build_criterion_from_config`, and
    :func:`rfdetr.detr._build_model_context` all call it directly to build a legacy namespace from configs.

    Args:
        model_config: Architecture configuration.
        train_config: Training hyperparameter configuration.
        defaults: Hardcoded architectural constants.  Defaults to :data:`MODEL_DEFAULTS`.

    Returns:
        ``types.SimpleNamespace`` compatible with ``build_model``, ``build_criterion_and_postprocessors``, and
        ``build_dataset``.
    )ÚincludeÚmask_ce_loss_coefg      @Úmask_dice_loss_coefÚmask_point_sample_ratioé   Ú Né*   )rQ   rR   rS   r?   r1   r.   © )r?   ÚtypesÚSimpleNamespaceÚdataclassesÚasdictÚ
model_dumpÚsetÚ_TC_NAMESPACE_FIELDSÚ_MC_NAMESPACE_FIELDSÚgetattrr1   r.   )rK   rL   rM   ÚmcÚtcÚdr?   s          úa/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/rfdetr/_namespace.pyÚ_namespace_from_configsre   o   sñ   € ð( 
€BØ	€BØ€AØÔ$€MåÔ ð ð ð
åÔ  Ñ#Ô#ð
ð
 �mŠm¥CÕ(<Ñ$=Ô$=ˆmÑ>Ô>ð
ð �mŠm¥CÕ(<Ñ$=Ô$=ˆmÑ>Ô>ð
õ ")¨Ð-@À#Ñ!FÔ!FÝ#*¨2Ð/DÀcÑ#JÔ#JÝ'.¨rÐ3LÈbÑ'QÔ'Qà*Ø”i�o 2Ø!œwÐ2�B”G�G¸ð!
ð 
ð 
ðð ð ó    )Ú__doc__rZ   rX   Úrfdetr.configr   r   Úrfdetr.models._defaultsr   r   r_   Ú_TC_NON_NAMESPACE_FIELDSr]   Úmodel_fieldsr^   rY   re   rW   rf   rd   ú<module>rl      sæ   ððð ð Ð Ð Ð Ø €€€à 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø AÐ AÐ AÐ AÐ AÐ AÐ AÐ Að'ð 'ð 'Ð ð`%ð %ð %Ð ðP �s˜;Ô3Ñ4Ô4Ð7OÑOÐ ð -ð,ð ,Øð,àð,ð ð,ð Ôð	,ð ,ð ,ð ,ð ,ð ,rf   