Ë
    Fêñiº  ã                  óR   — d dl mZ d dlmZ d dlZd dlmZ ddlmZ  G d„ de«      Z	y)	é    )Úannotations)ÚPathN)Úcheck_requirementsé   )ÚBaseBackendc                  ó    — e Zd ZdZdd„Zdd„Zy)ÚTritonBackendzÿNVIDIA Triton Inference Server backend for remote model serving.

    Connects to and runs inference with models hosted on an NVIDIA Triton Inference Server instance via HTTP or gRPC
    protocols. The model is specified using a triton:// URL scheme.
    c                ó¸   — t        d«       ddlm}  ||«      | _        t	        | j                  d«      r&| j                  | j                  j                  «       yy)zµConnect to a remote model on an NVIDIA Triton Inference Server.

        Args:
            weight (str | Path): Triton model URL (e.g., 'http://localhost:8000/model_name').
        ztritonclient[all]r   )ÚTritonRemoteModelÚmetadataN)r   Úultralytics.utils.tritonr   ÚmodelÚhasattrÚapply_metadatar   )ÚselfÚweightr   s      ú`/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/ultralytics/nn/backends/triton.pyÚ
load_modelzTritonBackend.load_model   sI   € ô 	Ð.Ô/Ý>á& vÓ.ˆŒ
ô �4—:‘:˜zÔ*Ø×Ñ §
¡
× 3Ñ 3Õ4ð +ó    c                ó\   — | j                  |j                  «       j                  «       «      S )a  Run inference via the NVIDIA Triton Inference Server.

        Args:
            im (torch.Tensor): Input image tensor in BCHW format, normalized to [0, 1].

        Returns:
            (list): Model predictions as a list of numpy arrays from the Triton server.
        )r   ÚcpuÚnumpy)r   Úims     r   ÚforwardzTritonBackend.forward$   s    € ð �z‰z˜"Ÿ&™&›(Ÿ.™.Ó*Ó+Ð+r   N)r   z
str | PathÚreturnÚNone)r   ztorch.Tensorr   Úlist)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r	   r	      s   „ ñó5ô	,r   r	   )
Ú
__future__r   Úpathlibr   ÚtorchÚultralytics.utils.checksr   Úbaser   r	   r"   r   r   ú<module>r(      s"   ðõ #å ã å 7å ô,�Kõ ,r   