vita-epfl / openpifpaf_wholebody

PifPaf extension to detect body, foot, face and hand keypoints.
Other
13 stars 0 forks source link

Instructions for training for subset of keypoints is failing #1

Open bungatlabs opened 1 year ago

bungatlabs commented 1 year ago

I am trying to train the model for a subset of keypoint against the COCO Wholebody dataset. I want to exclude face and hand keypoints. I have followed all steps here: https://openpifpaf.github.io/plugins_wholebody.html#using-only-a-subset-of-keypoints

Upon running the training command, I see an error indicating a mismatch in the number of keypoints the training code is expecting. It seems that I may have missed removing some parts of the code as specified in the instructions, but I can't seem to find what's wrong. Here is my script I used to generate the training data json, and the constants.py file.

If anything, there may be missing instructions in the documentation which would be great to fix. Any help in identifying what I may have missed, is greatly appreciated.

Apologies if there was a better forum to post this as a question, but I couldn't find it.

Here's the error stack.

Original Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/plugins/coco/dataset.py", line 129, in getitem image, anns, meta = self.preprocess(image, anns, meta) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/transforms/compose.py", line 15, in call args = p(*args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/transforms/encoders.py", line 10, in call anns = [enc(image, anns, meta) for enc in self.encoders] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/transforms/encoders.py", line 10, in anns = [enc(image, anns, meta) for enc in self.encoders] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/encoder/cif.py", line 28, in call return CifGenerator(self)(image, anns, meta) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/encoder/cif.py", line 59, in call self.fill(keypoint_sets) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/encoder/cif.py", line 83, in fill self.fill_keypoints(keypoints) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/encoder/cif.py", line 86, in fill_keypoints scale = self.rescaler.scale(keypoints) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openpifpaf/encoder/annrescaler.py", line 155, in scale (np.max(self.pose[visible, 0]) - np.min(self.pose[visible, 0])) IndexError: boolean index did not match indexed array along dimension 0; dimension is 133 but corresponding boolean dimension is 23

bungatlabs commented 1 year ago

I realized that I have not edited the correct constants.py file. I probably need to edit the source and recompile the whole openpifpaf source? Or is there a better way to do this?