def __getitem__(self, index): image, tags = super().__getitem__(index) if self.transform is not None: image = self.transform(image) label = one_hot_embedding([self.class_dic[tag] for tag in tags], self.classes) return image, label
def __getitem__(self, index): image, tags, mask = super().__getitem__(index) if self.transform is not None: input_dic = {'image':image, 'mask':mask} output_dic = self.transform(input_dic) image = output_dic['image'] mask = output_dic['mask'] label = one_hot_embedding([self.class_dic[tag] for tag in tags], self.classes) return image, label, mask
def __getitem__(self, index): image, image_id, tags, mask = super().__getitem__(index) label = one_hot_embedding([self.class_dic[tag] for tag in tags], self.classes) return image, image_id, label, mask