(self, transform, data_split)
| 33 | ] |
| 34 | class AGORA_MM(HumanDataset): |
| 35 | def __init__(self, transform, data_split): |
| 36 | super(AGORA_MM, self).__init__(transform, data_split) |
| 37 | self.img_shape = [2160,3840] |
| 38 | pre_prc_file_train = 'spec_train_smpl.npz' |
| 39 | pre_prc_file_test = 'spec_test_smpl.npz' |
| 40 | self.save_idx = 0 |
| 41 | if self.data_split == 'train': |
| 42 | filename = getattr(cfg, 'filename', pre_prc_file_train) |
| 43 | else: |
| 44 | self.test_set = 'val' |
| 45 | |
| 46 | self.img_dir = './data/datasets/agora' |
| 47 | |
| 48 | |
| 49 | if data_split == 'train': |
| 50 | if self.img_shape == [2160,3840]: |
| 51 | self.annot_path = 'data/preprocessed_npz/multihuman_data/agora_train_3840_w_occ_multi_2010.npz' |
| 52 | self.annot_path_cache = 'data/preprocessed_npz/cache/agora_train_3840_w_occ_cache_2010.npz' |
| 53 | elif self.img_shape == [720,1280]: |
| 54 | self.annot_path = 'data/preprocessed_npz/multihuman_data/agora_train_1280_multi_1010.npz' |
| 55 | self.annot_path_cache = 'data/preprocessed_npz/cache/agora_train_cache_1280_1010.npz' |
| 56 | |
| 57 | elif data_split == 'test': |
| 58 | if self.img_shape == [2160,3840]: |
| 59 | self.annot_path = 'data/preprocessed_npz/multihuman_data/agora_validation_multi_3840_1010.npz' |
| 60 | self.annot_path_cache = 'data/preprocessed_npz/cache/agora_validation_cache_3840_1010_occ_cache_balance.npz' |
| 61 | elif self.img_shape == [720,1280]: |
| 62 | self.annot_path = 'data/preprocessed_npz/multihuman_data/agora_validation_1280_1010_occ.npz' |
| 63 | self.annot_path_cache = 'data/preprocessed_npz/cache/agora_validation_cache_1280_1010_occ.npz' |
| 64 | |
| 65 | self.use_cache = getattr(cfg, 'use_cache', False) |
| 66 | self.cam_param = {} |
| 67 | |
| 68 | # load data or cache |
| 69 | if self.use_cache and osp.isfile(self.annot_path_cache): |
| 70 | print(f'[{self.__class__.__name__}] loading cache from {self.annot_path_cache}') |
| 71 | self.datalist = self.load_cache(self.annot_path_cache) |
| 72 | else: |
| 73 | if self.use_cache: |
| 74 | print(f'[{self.__class__.__name__}] Cache not found, generating cache...') |
| 75 | self.datalist = self.load_data( |
| 76 | train_sample_interval=getattr(cfg, f'{self.__class__.__name__}_train_sample_interval', 1)) |
| 77 | if self.use_cache: |
| 78 | self.save_cache(self.annot_path_cache, self.datalist) |
| 79 | |
| 80 | |
| 81 | def load_data(self, train_sample_interval=1): |
nothing calls this directly
no test coverage detected