Giter Site home page Giter Site logo

Comments (11)

Nicholasli1995 avatar Nicholasli1995 commented on June 26, 2024

hi how can I extract 2d poses from the resulted 3d pose (2d pose front view, back view, and side view) thanks

You can project the 3D pose to 2D with your camera parameters. Use different extrinsic rotation/translation for different views. Method in this repo that can be used is:

def project_point_radial( P, R, T, f, c, k, p ):

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

thanks for your replay, i am trying to do it for my own images where i do not have such information is there any default value for it.
Thanks in advance

from evoskeleton.

Nicholasli1995 avatar Nicholasli1995 commented on June 26, 2024

thanks for your replay, i am trying to do it for my own images where i do not have such information is there any default value for it. Thanks in advance

You do not need many parameters to simulate a pin-hole camera. Assume you have 3d pose [x, y, z] in the camera coordinate system (this repo contains it) and you can project it to the screen as [fx/z, fy/z] where f is your focal length. I would suggest you take a look at camera models. See https://docs.opencv.org/4.5.3/d9/d0c/group__calib3d.html for example.

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

Thanks for your replay
I am trying to use it for my own images i generate the pose using h36mpose.py and then run the inference but can i ask how to generate the stats.npy file ?

from evoskeleton.

Nicholasli1995 avatar Nicholasli1995 commented on June 26, 2024

Thanks for your replay I am trying to use it for my own images i generate the pose using h36mpose.py and then run the inference but can i ask how to generate the stats.npy file ?

Use this inference script https://github.com/Nicholasli1995/EvoSkeleton/blob/master/examples/inference.py. Download the file following the instruction here https://github.com/Nicholasli1995/EvoSkeleton/blob/master/docs/TRAINING.md.

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

thanks so much for your replay I follow the instructions I just have trouble showing the 2d projection from 3d pose as follows
index1

:
index
index5
index4
index3

How can I visualize it right so I can see how accurate the projected 2d poses?

Thanks for everything, the code and support.

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

i try to use the following code but yet did not get it

`def project_to_cameras(poses):
"""
Project 3d poses using camera parameters
input:
3D poses: [n_pose, pose length]
cams: list of camera parameters
return: list of 2D projections for each camera
cams:
"""
p_2d = []
rcams= np.load('/Pose_for_Re-id/EvoSkeleton_master/cameras.npy', allow_pickle=True).item()
#print('befor adding')
cams = add_virtual_cams(rcams)
#print('after adding')
# By default, all actions are used
ncams=4
for cam in range(ncams):
R, T, f, c, k, p, name = cams[(1, cam+1)]

    pts2d, _, _, _, _ = cameras.project_point_radial(np.reshape(poses, [-1, 3]), R, T, f, c, k, p )
    
    f = plt.figure(figsize=(9, 9))
    ax4 = plt.subplot(131)
    plt.title('2D key-point inputs: {:d}*2'.format(16))
    ax4.set_aspect('equal')
    ax4.invert_yaxis()
    skeleton_pred = None
       
    s2d=pts2d
    show2Dpose(np.reshape( pts2d, [-1, len(H36M_NAMES)*2]),ax4)
    p_2d.append(np.reshape( pts2d, [-1, len(H36M_NAMES)*2]))
    
return p_2d`

the results was
index15
index13
index12
index11
:

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

If I need to rotate around the y-axis what should I change?

from evoskeleton.

Nicholasli1995 avatar Nicholasli1995 commented on June 26, 2024

If I need to rotate around the y-axis what should I change?

See ax.set_xlim/set_ylim to control your 2D plot. Change R and T to the camera pose that you need.

from evoskeleton.

alsehaimaa avatar alsehaimaa commented on June 26, 2024

Thanks but wen i change the anagle in add_virtual_cams to:
new_R, new_T = get_new_camera(R.T, T, [0.,angle, 0.]) nothing changed.

from evoskeleton.

Nicholasli1995 avatar Nicholasli1995 commented on June 26, 2024

Thanks but wen i change the anagle in add_virtual_cams to: new_R, new_T = get_new_camera(R.T, T, [0.,angle, 0.]) nothing changed.

You do not understand the code and coordinate transformation and I don't have time for beginner tutorial. Why not you upload your 3D pose and I simply write you a script to run? You can create a page in the discussion and I'm closing this issue since it's not a bug.

from evoskeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.