diff --git a/easymocap/datasets/base.py b/easymocap/datasets/base.py index a059abb..c788451 100644 --- a/easymocap/datasets/base.py +++ b/easymocap/datasets/base.py @@ -230,7 +230,7 @@ class Base(BaseData): self.reader = reader self.writer = writer if camera != 'none': - if not os.path.isabs(camera): + if not os.path.exists(camera) and not os.path.isabs(camera): camera = join(self.root, camera) if os.path.exists(camera): cameras = read_cameras(camera) @@ -464,7 +464,10 @@ class ImageFolder(Base): data[key] = Undistort.points(data[key], K, dist) data[key+'_unproj'] = unproj(data[key], invK) for _key in [key, key+'_distort', key+'_unproj']: - self.cache_shape[_key] = np.zeros_like(data[_key]) + try: + self.cache_shape[_key] = np.zeros_like(data[_key]) + except KeyError: + print(f"missed key: {_key}") if self.loadmp: data['annots'] = data['annots']['annots'] # compose the data