(self, opt)
| 10 | @DATASET_REGISTRY.register() |
| 11 | class threeTaskDataset(data.Dataset): |
| 12 | def __init__(self, opt): |
| 13 | super(threeTaskDataset, self).__init__() |
| 14 | self.opt = opt |
| 15 | |
| 16 | self.ots_dataset = DehazeOTSBETADataset(opt, lq_path=opt['ots_lq_path'], gt_path=opt['ots_gt_path'],enlarge_ratio=opt['haze_enlarge_ratio']) |
| 17 | self.rain100L_dataset = Rain100LTrainDataset(opt, dataroot=opt['rain_path'],enlarge_ratio=opt['rain_enlarge_ratio']) |
| 18 | |
| 19 | augmentators1 = parse_degradations(opt['augment1']) |
| 20 | noise_dataset1 = [LowCostNoiseDataset(opt, dataroot=opt['bsd_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators1] |
| 21 | noise_dataset2 = [LowCostNoiseDataset(opt, dataroot=opt['wed_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators1] |
| 22 | augmentators2 = parse_degradations(opt['augment2']) |
| 23 | noise_dataset3 = [LowCostNoiseDataset(opt, dataroot=opt['bsd_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators2] |
| 24 | noise_dataset4 = [LowCostNoiseDataset(opt, dataroot=opt['wed_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators2] |
| 25 | augmentators3 = parse_degradations(opt['augment3']) |
| 26 | noise_dataset5 = [LowCostNoiseDataset(opt, dataroot=opt['bsd_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators3] |
| 27 | noise_dataset6 = [LowCostNoiseDataset(opt, dataroot=opt['wed_path'], augmentator=augmentator,enlarge_ratio=opt['noise_enlarge_ratio']) for augmentator in augmentators3] |
| 28 | |
| 29 | self.datasets = [self.ots_dataset, self.rain100L_dataset] + \ |
| 30 | noise_dataset1 + noise_dataset2 + noise_dataset3 + noise_dataset4 + noise_dataset5 + noise_dataset6 |
| 31 | |
| 32 | self.sample_ids = [] |
| 33 | for i, dataset in enumerate(self.datasets): |
| 34 | length = len(dataset) |
| 35 | for idx in range(length): |
| 36 | self.sample_ids.append({'dataset_idx': i, 'sample_idx': idx}) |
| 37 | |
| 38 | random.shuffle(self.sample_ids) |
| 39 | |
| 40 | def __getitem__(self, index): |
| 41 | sample_info = self.sample_ids[index] |
nothing calls this directly
no test coverage detected