a
    áñhÔ
  ã                   @   s  d dl Z d dlZddlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d d	lm
Z
 d dlZzdd
lmZ W n eyŽ   Y n0 esÚej ej e¡¡ej ej e ¡ ¡d¡krÚdZe  e e ¡ ¡¡ dadadd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )é    Né   )Ú_HAS_OPS)Úmodels)Údatasets)Úops)Ú
transforms)Úutils)Úio)Ú__version__ÚtorchvisionzÁYou are importing torchvision within its own root folder ({}). This is not expected to work and may give errors. Please exit the torchvision project source and relaunch your python interpreter.ÚPILÚpyavc                 C   s   | dvrt d | ¡ƒ‚| adS )a*  
    Specifies the package used to load images.

    Args:
        backend (string): Name of the image backend. one of {'PIL', 'accimage'}.
            The :mod:`accimage` package uses the Intel IPP library. It is
            generally faster than PIL, but does not support as many operations.
    )r   Zaccimagez6Invalid backend '{}'. Options are 'PIL' and 'accimage'N)Ú
ValueErrorÚformatÚ_image_backend)Úbackend© r   úT/home/yuhw/wc/uboone-dl-vtx/venv/lib/python3.9/site-packages/torchvision/__init__.pyÚset_image_backend!   s
    
ÿr   c                   C   s   t S )z:
    Gets the name of the package used to load images
    )r   r   r   r   r   Úget_image_backend1   s    r   c                 C   s:   | dvrt d|  ƒ‚| dkr2tjs2d}t |¡ n| adS )a  
    Specifies the package used to decode videos.

    Args:
        backend (string): Name of the video backend. one of {'pyav', 'video_reader'}.
            The :mod:`pyav` package uses the 3rd party PyAv library. It is a Pythonic
            binding for the FFmpeg libraries.
            The :mod:`video_reader` package includes a native C++ implementation on
            top of FFMPEG libraries, and a python API of TorchScript custom operator.
            It is generally decoding faster than :mod:`pyav`, but perhaps is less robust.
    )r   Úvideo_readerzAInvalid video backend '%s'. Options are 'pyav' and 'video_reader'r   zavideo_reader video backend is not available. Please compile torchvision from source and try againN)r   r	   Z_HAS_VIDEO_OPTÚwarningsÚwarnÚ_video_backend)r   Úmessager   r   r   Úset_video_backend8   s    ÿÿr   c                   C   s   t S ©N)r   r   r   r   r   Úget_video_backendS   s    r   c                   C   s
   t j ¡ S r   )ÚtorchZ_CZ_get_tracing_stater   r   r   r   Ú_is_tracingW   s    r   )r   ÚosÚ	extensionr   r   r   r   r   r   r   r	   r   Úversionr
   ÚImportErrorÚpathÚdirnameÚrealpathÚ__file__ÚjoinÚgetcwdr   r   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s2   ÿ