Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about different versions of mmpose #795

Closed
Deep-learning999 opened this issue Jul 20, 2021 · 9 comments · Fixed by #796
Closed

Questions about different versions of mmpose #795

Deep-learning999 opened this issue Jul 20, 2021 · 9 comments · Fixed by #796

Comments

@Deep-learning999
Copy link

When I run a cell

Visualize Skeleton vis_frames = vis_skeleton(vid_path, anno, gym_categories[anno['label']]) vid = mpy.ImageSequenceClip(vis_frames, fps=24) vid.ipython_display()

in mmaction2/demo/visualize_heatmap_volume.ipynb, it raise an 'devided by zero' error, I can run it correctly before.
I check the traceback, and I remember I changed my mmpose version from 0.13.0 to 0.16.0 to use the latest posec3d demo.(Posec3d demo can't use with the version of mmpose under 0.16.0)

How to solve this problem

@jin-s13
Copy link
Collaborator

jin-s13 commented Jul 20, 2021

Please also raise an issue in mmaction2.

@Deep-learning999
Copy link
Author

There are already similar problems above and have not been solved yet
open-mmlab/mmaction2#1029

@jin-s13
Copy link
Collaborator

jin-s13 commented Jul 20, 2021

@kennymckormick

@ly015
Copy link
Member

ly015 commented Jul 20, 2021

Could you please upload full error information to help us locate the problem? @Deep-learning999

@Deep-learning999
Copy link
Author

TypeError Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/numpy/lib/shape_base.py in split(ary, indices_or_sections, axis)
866 try:
--> 867 len(indices_or_sections)
868 except TypeError:

TypeError: object of type 'int' has no len()

During handling of the above exception, another exception occurred:

ZeroDivisionError Traceback (most recent call last)
in
1 # Visualize Skeleton
----> 2 vis_frames = vis_skeleton(vid_path, anno, gym_categories[anno['label']])
3 #vid = mpy.ImageSequenceClip(vis_frames, fps=24)
4 #vid.ipython_display()

in vis_skeleton(vid_path, anno, category_name, ratio)
56 bbox = np.zeros([0, 4], dtype=np.float32)
57 result = [dict(bbox=bbox, keypoints=k) for k in kp]
---> 58 vis_frame = vis_pose_result(model, f, result)
59
60 if category_name is not None:

mmpose/mmpose/apis/inference.py in vis_pose_result(model, img, result, radius, thickness, kpt_score_thr, bbox_color, dataset, show, out_file)
748 raise NotImplementedError()
749
--> 750 img = model.show_result(
751 img,
752 result,

/mmpose/mmpose/models/detectors/top_down.py in show_result(self, img, result, skeleton, kpt_score_thr, bbox_color, pose_kpt_color, pose_limb_color, text_color, radius, thickness, font_scale, bbox_thickness, win_name, show, show_keypoint_weight, wait_time, out_file)
279 labels = [res['label'] for res in result]
280 # draw bounding boxes
--> 281 imshow_bboxes(
282 img,
283 bboxes,

/mmpose/mmpose/core/visualization/image.py in imshow_bboxes(img, bboxes, labels, colors, text_color, thickness, font_scale, show, win_name, wait_time, out_file)
40
41 # adapt to mmcv.imshow_bboxes input format
---> 42 bboxes = np.split(bboxes, bboxes.shape[0], axis=0)
43 if not isinstance(colors, list):
44 colors = [colors for _ in range(len(bboxes))]

<array_function internals> in split(*args, **kwargs)

/usr/local/lib/python3.8/dist-packages/numpy/lib/shape_base.py in split(ary, indices_or_sections, axis)
869 sections = indices_or_sections
870 N = ary.shape[axis]
--> 871 if N % sections:
872 raise ValueError(
873 'array split does not result in an equal division') from None

ZeroDivisionError: integer division or modulo by zero

@Deep-learning999
Copy link
Author

I want to install the latest version of mmpose and mmaction2 will have this problem

@ly015
Copy link
Member

ly015 commented Jul 20, 2021

mmpose v0.13.0 uses imshow_bbox from mmcv. mmpose v0.16.0 switched to imshow_bbox implemented in mmpose for better visualization effect, which failed to handle the case of empty input bbox. This will be fixed soon.

@kennymckormick
Copy link
Member

We will try to fix that problem in mmaction2.

@Deep-learning999
Copy link
Author

Okay thank you

rollingman1 pushed a commit to rollingman1/mmpose that referenced this issue Nov 5, 2021
…dels (open-mmlab#795)

* first commit

* fix bugs

* add logging

* add changelog

* add writing to local file

* fix sampeling strategy bug

* update annotations, remove global variables

* update docs

* decouple display frame shape and model frame shape

* fix known issue

* fix display default shape and fix visualize tools

* fix predict_stepsize bug

* add cn docs

* update

* fix

* update color plate docs

* fix a bug when drawing

* add alphaction visualization tool

* add visualization tool docs

* fix a few bugs

* typo

* remove alphaction visualization tool due to licence issue

* typo

Co-authored-by: Haodong Duan <[email protected]>
HAOCHENYE added a commit to HAOCHENYE/mmpose that referenced this issue Jun 27, 2023
* [Feature] Add BaseInferencer (open-mmlab#773)

* Update BaseInferencer

* Fix ci

* Fix CI and rename iferencer to infer

* Fix CI

* Add renamed file

* Add test file

* Adjust interface sequence

* refine preprocess

* Update unit test

Update unit test

* Update unit test

* Fix unit test

* Fix as comment

* Minor refine

* Fix docstring and support load image from different backend

* Support load collate_fn from downstream repos, refine dispatch

* Minor refine

* Fix lint

* refine grammar

* Remove FileClient

* Refine docstring

* add rich

* Add list_models

* Add list_models

* Remove backend args

* Minor refine

* Fix typos in docs and type hints (open-mmlab#787)

* [Fix] Add _inputs_to_list (open-mmlab#795)

* Add preprocess inputs

* Add type hint

* update api/infer in index.rst

* rename preprocess_inputs to _inputs_to_list

* Fix doc format

* Update infer.py

Co-authored-by: Zaida Zhou <[email protected]>

* [Fix] Fix alias type (open-mmlab#801)

* [Enhance] Support loading model config from checkpoint (open-mmlab#864)

* first commit

* [Enhance] Support build model from weight

* minor refine

* Fix type hint

* refine comments

* Update docstring

* refine as comment

* Add  method

* Refine docstring

* Fix as comment

* refine comments

* Refine warning message

* Fix unit test and refine comments

* replace MODULE2PACKAGE to MODULE2PAKCAGE

* Fix typo and syntax error in docstring

Co-authored-by: Zaida Zhou <[email protected]>
Co-authored-by: Tong Gao <[email protected]>
HAOCHENYE added a commit to HAOCHENYE/mmpose that referenced this issue Jun 27, 2023
* [Feature] Add BaseInferencer (open-mmlab#773)

* Update BaseInferencer

* Fix ci

* Fix CI and rename iferencer to infer

* Fix CI

* Add renamed file

* Add test file

* Adjust interface sequence

* refine preprocess

* Update unit test

Update unit test

* Update unit test

* Fix unit test

* Fix as comment

* Minor refine

* Fix docstring and support load image from different backend

* Support load collate_fn from downstream repos, refine dispatch

* Minor refine

* Fix lint

* refine grammar

* Remove FileClient

* Refine docstring

* add rich

* Add list_models

* Add list_models

* Remove backend args

* Minor refine

* Fix typos in docs and type hints (open-mmlab#787)

* [Fix] Add _inputs_to_list (open-mmlab#795)

* Add preprocess inputs

* Add type hint

* update api/infer in index.rst

* rename preprocess_inputs to _inputs_to_list

* Fix doc format

* Update infer.py

Co-authored-by: Zaida Zhou <[email protected]>

* [Fix] Fix alias type (open-mmlab#801)

* [Enhance] Support loading model config from checkpoint (open-mmlab#864)

* first commit

* [Enhance] Support build model from weight

* minor refine

* Fix type hint

* refine comments

* Update docstring

* refine as comment

* Add  method

* Refine docstring

* Fix as comment

* refine comments

* Refine warning message

* Fix unit test and refine comments

* add infer.md

* minor refine

* minor refine

* minor refine

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <[email protected]>

* Fix conflicts and minor refine

* minor refine

* Fix as comment

Co-authored-by: Zaida Zhou <[email protected]>
Co-authored-by: Tong Gao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants