a
    þd	  ã                   @   sP   d dl mZmZ d dlmZmZ d dlmZ G dd„ deƒZG dd„ deƒZ	dS )	é    )ÚAnyÚ
Collection)ÚModifiedPanopticQualityÚPanopticQuality)Ú_deprecated_root_import_classc                       s8   e Zd ZdZdee ee eeddœ‡ fdd„Z‡  Z	S )Ú_ModifiedPanopticQualitya{  Wrapper for deprecated import.

    >>> from torch import tensor
    >>> preds = tensor([[[0, 0], [0, 1], [6, 0], [7, 0], [0, 2], [1, 0]]])
    >>> target = tensor([[[0, 1], [0, 0], [6, 0], [7, 0], [6, 0], [255, 0]]])
    >>> pq_modified = _ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
    >>> pq_modified(preds, target)
    tensor(0.7667, dtype=torch.float64)

    FN©ÚthingsÚstuffsÚallow_unknown_preds_categoryÚkwargsÚreturnc                    s(   t ddƒ tƒ jf |||dœ|¤Ž d S )Nr   Ú	detection©r	   r
   r   ©r   ÚsuperÚ__init__©Úselfr	   r
   r   r   ©Ú	__class__© úk/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/torchmetrics/detection/_deprecated.pyr      s    
ÿÿz!_ModifiedPanopticQuality.__init__)F©
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚintÚboolr   r   Ú__classcell__r   r   r   r   r      s    üúr   c                       s8   e Zd ZdZdee ee eeddœ‡ fdd„Z‡  Z	S )Ú_PanopticQualitya;  Wrapper for deprecated import.

    >>> from torch import tensor
    >>> preds = tensor([[[[6, 0], [0, 0], [6, 0], [6, 0]],
    ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
    ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
    ...                  [[0, 0], [7, 0], [6, 0], [1, 0]],
    ...                  [[0, 0], [7, 0], [7, 0], [7, 0]]]])
    >>> target = tensor([[[[6, 0], [0, 1], [6, 0], [0, 1]],
    ...                   [[0, 1], [0, 1], [6, 0], [0, 1]],
    ...                   [[0, 1], [0, 1], [6, 0], [1, 0]],
    ...                   [[0, 1], [7, 0], [1, 0], [1, 0]],
    ...                   [[0, 1], [7, 0], [7, 0], [7, 0]]]])
    >>> panoptic_quality = _PanopticQuality(things = {0, 1}, stuffs = {6, 7})
    >>> panoptic_quality(preds, target)
    tensor(0.5463, dtype=torch.float64)

    FNr   c                    s(   t ddƒ tƒ jf |||dœ|¤Ž d S )Nr   r   r   r   r   r   r   r   r   4   s    
ÿÿz_PanopticQuality.__init__)Fr   r   r   r   r   r!       s    üúr!   N)
Útypingr   r   Ztorchmetrics.detectionr   r   Ztorchmetrics.utilities.printsr   r   r!   r   r   r   r   Ú<module>   s   