| 105 | |
| 106 | |
| 107 | def get_data(cfg, split, base_size, crop_size, batch_size=1, gpu_num=1): |
| 108 | if cfg.DATASET.DATASET_NAME.lower() in ['cityscapes', 'pascal_context']: |
| 109 | dataset_name = cfg.DATASET.DATASET_NAME.lower() |
| 110 | data_loader = globals()[dataset_name + '_' + split] |
| 111 | return data_loader(root=cfg.DATASET.DATA_ROOT, |
| 112 | base_size=base_size, |
| 113 | crop_size=crop_size, |
| 114 | scale=True, |
| 115 | xmap=True, |
| 116 | batch_size=batch_size, |
| 117 | gpu_num=gpu_num) |
| 118 | else: |
| 119 | raise ValueError('Dataset is not supported, please check!') |
| 120 | |
| 121 | def get_loss_weight(cfg): |
| 122 | if cfg.DATASET.DATASET_NAME.lower() == 'cityscapes': |