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

arrow keyboard doesn't work (Fixed: for matplotlib > 3) #37

Closed
KamiCalcium opened this issue Jul 3, 2021 · 6 comments
Closed

arrow keyboard doesn't work (Fixed: for matplotlib > 3) #37

KamiCalcium opened this issue Jul 3, 2021 · 6 comments

Comments

@KamiCalcium
Copy link

Hi,

Great work!

When I try the 3D Skeleton Interactive Annotation using the pre-trained weights, the keyboard is not working correctly. 0-9 are fine, the figure shows the different selected limb when I click. However, arrow keyboards are not working:

Traceback (most recent call last):
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 224, in process
    func(*args, **kwargs)
  File "annotate_3D.py", line 96, in press
    update_skeleton(angle_idx, event.key)
  File "annotate_3D.py", line 337, in update_skeleton
    update_global(angle_idx)
  File "annotate_3D.py", line 282, in update_global
    update_line(line_idx, parent_idx, child_idx)
  File "annotate_3D.py", line 265, in update_line
    lines[line_idx][0].set_3d_properties(z)
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/mpl_toolkits/mplot3d/art3d.py", line 143, in set_3d_properties
    zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'

up, down, right or left all shows the same error. I tried debug thru printing the (event.key) and it shows that the received keyboard is correct (i.e. printing up, down, left, right when I click the corresponding key).

Could you please take a look on this? Thanks a lot!

@Nicholasli1995
Copy link
Owner

Hi,

Great work!

When I try the 3D Skeleton Interactive Annotation using the pre-trained weights, the keyboard is not working correctly. 0-9 are fine, the figure shows the different selected limb when I click. However, arrow keyboards are not working:

Traceback (most recent call last):
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 224, in process
    func(*args, **kwargs)
  File "annotate_3D.py", line 96, in press
    update_skeleton(angle_idx, event.key)
  File "annotate_3D.py", line 337, in update_skeleton
    update_global(angle_idx)
  File "annotate_3D.py", line 282, in update_global
    update_line(line_idx, parent_idx, child_idx)
  File "annotate_3D.py", line 265, in update_line
    lines[line_idx][0].set_3d_properties(z)
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/mpl_toolkits/mplot3d/art3d.py", line 143, in set_3d_properties
    zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'

up, down, right or left all shows the same error. I tried debug thru printing the (event.key) and it shows that the received keyboard is correct (i.e. printing up, down, left, right when I click the corresponding key).

Could you please take a look on this? Thanks a lot!

I'm working on this issue. The tools was tested on matplotlib 2.2.2 and is not working on matplotlib 3. Will let you know once I update the tool.

@Nicholasli1995
Copy link
Owner

Hi,

Great work!

When I try the 3D Skeleton Interactive Annotation using the pre-trained weights, the keyboard is not working correctly. 0-9 are fine, the figure shows the different selected limb when I click. However, arrow keyboards are not working:

Traceback (most recent call last):
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 224, in process
    func(*args, **kwargs)
  File "annotate_3D.py", line 96, in press
    update_skeleton(angle_idx, event.key)
  File "annotate_3D.py", line 337, in update_skeleton
    update_global(angle_idx)
  File "annotate_3D.py", line 282, in update_global
    update_line(line_idx, parent_idx, child_idx)
  File "annotate_3D.py", line 265, in update_line
    lines[line_idx][0].set_3d_properties(z)
  File "/anaconda3/envs/pytorch/lib/python3.6/site-packages/mpl_toolkits/mplot3d/art3d.py", line 143, in set_3d_properties
    zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'

up, down, right or left all shows the same error. I tried debug thru printing the (event.key) and it shows that the received keyboard is correct (i.e. printing up, down, left, right when I click the corresponding key).

Could you please take a look on this? Thanks a lot!

Hi, I have fixed the version problem. You can pull the code and it should work fine.
The tested environment is: numpy 1.19 + matplotlib 3.3.4 + scipy 1.5.2

@Nicholasli1995 Nicholasli1995 changed the title arrow keyboard doesn't work arrow keyboard doesn't work (Fixed: for matplotlib > 3) Jul 3, 2021
@Nicholasli1995
Copy link
Owner

Re-open this issue if the patch does not solve your problem.

@KamiCalcium
Copy link
Author

KamiCalcium commented Jul 10, 2021

Hi,

Thanks for fixing. Now the 3D annotation works. However, annotation for 2D annotations seem doesn't work either under matplotlib > 3. Could you please check and fix too? There's no respond after I click mouse. Only Q can exit. N, C, Z, and mouse click don't work at all.

@KamiCalcium
Copy link
Author

KamiCalcium commented Jul 10, 2021

Re-open this issue if the patch does not solve your problem.

I don't think I can re-open it if it was not me that closed it. Could you please re-open this issue?

@Nicholasli1995
Copy link
Owner

Hi,

Thanks for fixing. Now the 3D annotation works. However, annotation for 2D annotations seem doesn't work either under matplotlib > 3. Could you please check and fix too? There's no respond after I click mouse. Only Q can exit. N, C, Z, and mouse click don't work at all.

I have fixed annotate_2d.py. It should work now.

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

No branches or pull requests

2 participants