From 1c1cdca2a3ca15f3a927e276a9ebfebb44715343 Mon Sep 17 00:00:00 2001 From: "xiaoke@ivgsz_171" Date: Tue, 7 Feb 2023 15:36:19 +0800 Subject: [PATCH 1/4] fix openpose path bug --- easymocap/estimator/openpose_wrapper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easymocap/estimator/openpose_wrapper.py b/easymocap/estimator/openpose_wrapper.py index 3479817..bf57f76 100644 --- a/easymocap/estimator/openpose_wrapper.py +++ b/easymocap/estimator/openpose_wrapper.py @@ -18,6 +18,9 @@ from glob import glob from multiprocessing import Process def run_openpose(image_root, annot_root, config): + image_root = os.path.realpath(image_root) + annot_root = os.path.realpath(annot_root) + os.makedirs(annot_root, exist_ok=True) pwd = os.getcwd() if os.name != 'nt': From a308bfee18e59d37cffc14f372b6aced0ab327af Mon Sep 17 00:00:00 2001 From: "xiaoke@ivgsz_171" Date: Tue, 7 Feb 2023 15:36:51 +0800 Subject: [PATCH 2/4] fix camera path bug --- easymocap/datasets/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 From 31f3b2022e795f0ada3b4387011b9caaa2714e6f Mon Sep 17 00:00:00 2001 From: "xiaoke@ivgsz_171" Date: Tue, 7 Feb 2023 16:01:43 +0800 Subject: [PATCH 3/4] check the number of images --- easymocap/datasets/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/easymocap/datasets/base.py b/easymocap/datasets/base.py index c788451..0885c71 100644 --- a/easymocap/datasets/base.py +++ b/easymocap/datasets/base.py @@ -42,6 +42,10 @@ def get_allname(root0, subs, ranges, root, ext, **kwargs): else: _ranges = ranges nv = subs.index(sub) + + if len(imgnames) < _ranges[1]: + raise ValueError('The number of images in {} is less than the range: {} vs {}'.format(join(root0, root, sub), len(imgnames), _ranges[1])) + for nnf, nf in enumerate(range(*_ranges)): image_names.append({ 'sub': sub, From c15030f76a8fc07a72134e5f3e79ca588b08ea37 Mon Sep 17 00:00:00 2001 From: "xiaoke@ivgsz_171" Date: Tue, 7 Feb 2023 16:02:02 +0800 Subject: [PATCH 4/4] comment debug print --- easymocap/multistage/base_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easymocap/multistage/base_ops.py b/easymocap/multistage/base_ops.py index f49b6db..ae40a8b 100644 --- a/easymocap/multistage/base_ops.py +++ b/easymocap/multistage/base_ops.py @@ -33,7 +33,7 @@ class SkipPoses(BeforeAfterBase): def before(self, body_params): poses = body_params['poses'] poses_copy = torch.zeros_like(poses) - print(poses.shape) + # print(poses.shape) poses_copy[..., self.copy_index] = poses[..., self.copy_index] body_params['poses'] = poses_copy return body_params \ No newline at end of file