def __getitem__(self, index):
        """
        Args:
            index (int): Index

        Returns:
            tuple: (image, target) where target is a dictionary of the XML tree.
        """
        img = Image.open(self.images[index]).convert('RGB')
        target = self.parse_voc_xml(
            ET.parse(self.annotations[index]).getroot())

        if self.transforms is not None:
            img, target = self.transforms(img, target)

        return img, target
def __getitem__ ( self , index ) : img = Image . open ( self . images [ index ] ) . convert ( 'RGB' ) target = self . parse_voc_xml ( ET . parse ( self . annotations [ index ] ) . getroot ( ) ) if self . transforms is not None : img , target = self . transforms ( img , target ) return img , target
Args:
            index (int): Index

        Returns:
            tuple: (image, target) where target is a dictionary of the XML tree.