a
    d                     @   s|   d dl mZ d dlmZ d dlmZmZ d dlmZ deeee	 ee	 e
edddZdeeee	 ee	 e
edd	d
ZdS )    )
Collection)Tensor)modified_panoptic_qualitypanoptic_quality)_deprecated_root_import_funcF)predstargetthingsstuffsallow_unknown_preds_categoryreturnc                 C   s   t dd t| ||||dS )a[  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]]])
    >>> _modified_panoptic_quality(preds, target, things = {0, 1}, stuffs = {6, 7})
    tensor(0.7667, dtype=torch.float64)

    r   	detectionr   r   r	   r
   r   )r   r   r    r   v/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/torchmetrics/functional/detection/_deprecated.py_modified_panoptic_quality	   s    
r   c                 C   s   t dd t| ||||dS )a  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(preds, target, things = {0, 1}, stuffs = {6, 7})
    tensor(0.5463, dtype=torch.float64)

    r   r   r   )r   r   r   r   r   r   _panoptic_quality#   s    
r   N)F)F)typingr   Ztorchr   Z4torchmetrics.functional.detection.panoptic_qualitiesr   r   Ztorchmetrics.utilities.printsr   intboolr   r   r   r   r   r   <module>   s*     