Ë
    Fêñi'  ã                   ó  — d dl mZmZmZ 	 erJ ‚ed   du sJ ‚d dlZd dlmZ  eed«      sJ ‚daddeded	dfd
„Zddeded	dfd„Zdeded	dfd„Zdd„Zdd„Zdd„Zdd„Zdd„Zer	eeeeedœZyi Zy# e	e
f$ r dZY ŒMw xY w)é    )ÚLOGGERÚSETTINGSÚTESTS_RUNNINGÚneptuneTN)ÚFileÚ__version__ÚscalarsÚstepÚreturnc                 óv   — t         r3| j                  «       D ]  \  }}t         |   j                  ||¬«       Œ! yy)aE  Log scalars to the NeptuneAI experiment logger.

    Args:
        scalars (dict): Dictionary of scalar values to log to NeptuneAI.
        step (int, optional): The current step or iteration number for logging.

    Examples:
        >>> metrics = {"mAP": 0.85, "loss": 0.32}
        >>> _log_scalars(metrics, step=100)
    )Úvaluer
   N)ÚrunÚitemsÚappend)r	   r
   ÚkÚvs       úe/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/ultralytics/utils/callbacks/neptune.pyÚ_log_scalarsr      s9   € õ Ø—M‘M“Oò 	.‰DˆAˆqÜ�‰F�M‰M ¨ˆMÕ-ñ	.ð ó    Ú	imgs_dictÚgroupc                 óŽ   — t         r?| j                  «       D ]+  \  }}t         |› d|› �   j                  t        |«      «       Œ- yy)a  Log images to the NeptuneAI experiment logger.

    This function logs image data to Neptune.ai when a valid Neptune run is active. Images are organized under the
    specified group name.

    Args:
        imgs_dict (dict): Dictionary of images to log, with keys as image names and values as image data.
        group (str, optional): Group name to organize images under in the Neptune UI.

    Examples:
        >>> # Log validation images
        >>> _log_images({"val_batch": img_tensor}, group="validation")
    ú/N)r   r   Úuploadr   )r   r   r   r   s       r   Ú_log_imagesr   $   sG   € õ Ø—O‘OÓ%ò 	0‰DˆAˆqÜ�5�'˜˜1˜#�Ñ×&Ñ&¤t¨A£wÕ/ñ	0ð r   ÚtitleÚ	plot_pathc                 óæ   — ddl m} ddlm} |j	                  |«      }|j                  «       }|j                  g d¢ddg g ¬«      }|j                  |«       t        d| › �   j                  |«       y)z-Log plots to the NeptuneAI experiment logger.r   N)r   r   é   r   FÚauto)ÚframeonÚaspectÚxticksÚytickszPlots/)
Úmatplotlib.imageÚimageÚmatplotlib.pyplotÚpyplotÚimreadÚfigureÚadd_axesÚimshowr   r   )r   r   ÚmpimgÚpltÚimgÚfigÚaxs          r   Ú	_log_plotr2   7   s_   € å$Ý#à
�,‰,�yÓ
!€CØ
�*‰*‹,€CØ	�‰’l¨E¸&ÈÐTVˆÓ	W€BØ‡I�Iˆc„NÜˆ&��ÐÑ× Ñ  Õ%r   c                 ó|  — 	 t        j                  | j                  j                  xs d| j                  j                  dg¬«      at        | j                  «      j                  «       D ��ci c]  \  }}||€dn|“Œ c}}t
        d<   yc c}}w # t        $ r"}t        j                  d|› �«       Y d}~yd}~ww xY w)zHInitialize NeptuneAI run and log hyperparameters before training starts.ÚUltralytics)ÚprojectÚnameÚtagsNÚ zConfiguration/HyperparameterszINeptuneAI installed but not initialized correctly, not logging this run. )r   Úinit_runÚargsr5   r6   r   Úvarsr   Ú	Exceptionr   Úwarning)Útrainerr   r   Úes       r   Úon_pretrain_routine_startr@   C   s©   € ð	hä×ÑØ—L‘L×(Ñ(Ò9¨MØ—‘×"Ñ"Ø�ô
ˆô
 W[Ð[b×[gÑ[gÓVh×VnÑVnÓVp×/qÉdÈaÐQR°¸¸±2ÈÑ0IÓ/qŒÐ+Ò,ùÓ/qøÜò hÜ�‰ÐbÐcdÐbeÐf×gÑgûðhús*   ‚A+B Á-B
Á>B Â
B Â	B;ÂB6Â6B;c           	      ój  — t        | j                  | j                  d¬«      | j                  dz   «       t        | j                  | j                  dz   «       | j                  dk(  rHt        | j                  j                  d«      D �ci c]  }|j                  t        |«      “Œ c}d«       yyc c}w )zILog training metrics and learning rate at the end of each training epoch.Útrain)Úprefixr   ztrain_batch*.jpgÚMosaicN)
r   Úlabel_loss_itemsÚtlossÚepochÚlrr   Úsave_dirÚglobÚstemÚstr©r>   Úfs     r   Úon_train_epoch_endrO   Q   s‰   € ä�×)Ñ)¨'¯-©-ÀÐ)ÓHÈ'Ï-É-ÐZ[ÑJ[Ô\Ü�—‘˜WŸ]™]¨QÑ.Ô/Ø‡}�}˜ÒÜ¨W×-=Ñ-=×-BÑ-BÐCUÓ-VÖW¨�Q—V‘VœS ›V‘^ÒWÐYaÕbð ùÚWs   Â	B0c                 óž   — t         r$| j                  dk(  rddlm}  || «      t         d<   t	        | j
                  | j                  dz   «       y)zCLog model info and validation metrics at the end of each fit epoch.r   )Úmodel_info_for_loggerszConfiguration/Modelr   N)r   rG   Úultralytics.utils.torch_utilsrQ   r   Úmetrics)r>   rQ   s     r   Úon_fit_epoch_endrT   Y   s:   € å
ˆw�}‰} Ò!ÝHá%;¸GÓ%DŒÐ!Ñ"Ü�—‘ '§-¡-°!Ñ"3Õ4r   c           	      óª   — t         rHt        | j                  j                  d«      D �ci c]  }|j                  t        |«      “Œ c}d«       yyc c}w )z/Log validation images at the end of validation.zval*.jpgÚ
ValidationN)r   r   rI   rJ   rK   rL   )Ú	validatorrN   s     r   Ú
on_val_endrX   b   s@   € å
ä¨Y×-?Ñ-?×-DÑ-DÀZÓ-PÖQ¨�Q—V‘VœS ›V‘^ÒQÐS_Õ`ð ùâQs   ©Ac                 óÜ  — t         ræg | j                  j                  «       ¢| j                  j                  j                  «       ¢D ](  }d|j                  vsŒt        |j                  |¬«       Œ* t         d| j                  j                  xs | j                  j                  › d| j                  j                  › �   j                  t        t        | j                  «      «      «       yy)zCLog final results, plots, and model weights at the end of training.Úbatch)r   r   zweights/r   N)r   ÚplotsÚkeysrW   r6   r2   rK   r:   ÚtaskÚbestr   r   rL   rM   s     r   Úon_train_endr_   i   s¹   € å
àI�7—=‘=×%Ñ%Ó'ÐI¨'×*;Ñ*;×*AÑ*A×*FÑ*FÓ*HÐIò 	5ˆAØ˜aŸf™fÒ$Ü §¡°!Ö4ð	5ô 	ˆh�w—|‘|×(Ñ(Ò=¨G¯L©L×,=Ñ,=Ð>¸aÀÇÁ×@QÑ@QÐ?RÐSÑT×[Ñ[Ô\`ÔadÐel×eqÑeqÓarÓ\sÕtð r   )r@   rO   rT   rX   r_   )r   )r8   )r   N)Úultralytics.utilsr   r   r   r   Úneptune.typesr   Úhasattrr   ÚImportErrorÚAssertionErrorÚdictÚintr   rL   r   r2   r@   rO   rT   rX   r_   Ú	callbacks© r   r   ú<module>ri      sú   ð÷ >Ñ =ðÙÐÐØ�IÑ $Ñ&Ð&Ð&ãÝ"á�7˜MÔ*Ð*Ð*à
€Cñ.˜$ð . cð .°$ó .ñ 0˜4ð 0¨ð 0°Tó 0ð&	&�Sð 	& Sð 	&¨Tó 	&óhócó5óaóuñ& ð &?Ø0Ø,Ø Ø$ññ 
ð 
ñ 
øðI 	�^Ð$ò Ø‚Gðús   Œ$A2 Á2	A>Á=A>