CoolFace
Apppublic

Mjolnir65/FasterRCNN

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
image_list.cpython-37.pyc23 linesDownload Raw Back to __pycache__
1B

2��h�@s6ddlmZmZddlZddlmZGdd�d�ZdS)�)�List�TupleN)�Tensorc@s@eZdZdZeeeeefdd�dd�Ze	j3dd�dd�ZdS)	�	ImageListaq4    Structure that holds a list of images (of possibly5    varying sizes) as a single tensor.6    This works by padding the images to the same size,7    and storing in a field the original sizes of each image8 9    Args:10        tensors (tensor): Tensor containing images.11        image_sizes (list[tuple[int, int]]): List of Tuples each containing size of images.12    N)�tensors�image_sizes�returncCs||_||_dS)N)rr)�selfrr�r13�8/home/rohit/Desktop/Sem6/CV/q1.2/detection/image_list.py�__init__szImageList.__init__)�devicercCs|j�|�}t||j�S)N)r�torr)r	r
�cast_tensorr14r15rrszImageList.to)�__name__�16__module__�__qualname__�__doc__rrr�intr�torchr
rr17r18r19rrs20r)�typingrrrrrr21r22r23r�<module>s