(self, transform, data_split)
| 30 | ] |
| 31 | class UBody_MM(HumanDataset): |
| 32 | def __init__(self, transform, data_split): |
| 33 | super(UBody_MM, self).__init__(transform, data_split) |
| 34 | |
| 35 | self.img_dir = 'data/osx_data/UBody' |
| 36 | self.data_split = data_split |
| 37 | self.test_vid_list = np.load('data/osx_data/UBody/splits/intra_scene_test_list.npy') |
| 38 | if self.data_split == 'train': |
| 39 | # self.annot_path = 'data/preprocessed_npz/multihuman_data/ubody_intra_train_multi_all.npz' |
| 40 | # self.annot_path_cache = 'data/preprocessed_npz/cache/ubody_intra_train_cache_fix8.npz' |
| 41 | self.annot_path = 'data/preprocessed_npz/multihuman_data/ubody_train_intra_multi.npz' |
| 42 | self.annot_path_cache = 'data/preprocessed_npz/cache/ubody_train_intra_cache_080824.npz' |
| 43 | self.sample_interval = getattr( |
| 44 | cfg, f'{self.__class__.__name__}_train_sample_interval', 5) |
| 45 | elif self.data_split == 'test': |
| 46 | self.annot_path = 'data/preprocessed_npz/ubody_intra_test_all.npz' |
| 47 | self.annot_path_cache = 'data/preprocessed_npz/cache/ubody_intra_test_multi_all_smpler_x.npz' |
| 48 | self.sample_interval = getattr( |
| 49 | cfg, f'{self.__class__.__name__}_test_sample_interval', 100) |
| 50 | # self.test_set = 'val' |
| 51 | self.use_cache = getattr(cfg, 'use_cache', False) |
| 52 | self.img_shape = None #1024, 1024) # (h, w) |
| 53 | self.cam_param = {} |
| 54 | self.keypoints2d = 'keypoints2d_ubody' |
| 55 | # load data |
| 56 | if self.use_cache and osp.isfile(self.annot_path_cache): |
| 57 | print( |
| 58 | f'[{self.__class__.__name__}] loading cache from {self.annot_path_cache}' |
| 59 | ) |
| 60 | self.datalist = self.load_cache(self.annot_path_cache) |
| 61 | else: |
| 62 | if self.use_cache: |
| 63 | print( |
| 64 | f'[{self.__class__.__name__}] Cache not found, generating cache...' |
| 65 | ) |
| 66 | self.datalist = self.load_data(train_sample_interval=self.sample_interval) |
| 67 | |
| 68 | if self.use_cache: |
| 69 | self.save_cache(self.annot_path_cache, self.datalist) |
| 70 | |
| 71 | |
| 72 | def evaluate(self, outs, cur_sample_idx): |
nothing calls this directly
no test coverage detected