def get_R(self, im_index, cls_idx): cams = [] f_list = glob.glob(osp.join(self._model_path, self._classes[cls_idx], '*_camera.mat')) for f in f_list: cams.append(read_camera(f)) camR = np.stack([c[1] for c in cams], axis=0) return camR
def get_K(self, sid, mid, idx): rand_idx = idx cams = [] for ix in rand_idx: f = osp.join(self.im_dir, sid, mid, 'camera_{:d}.mat'.format(ix)) cams.append(read_camera(f)) camK = np.stack([c[0] for c in cams], axis=0) return camK