Colin97 / OpenShape_code

official code of “OpenShape: Scaling Up 3D Shape Representation Towards Open-World Understanding”
https://colin97.github.io/OpenShape/
Apache License 2.0
224 stars 15 forks source link

Camera poses for rendered images #15

Closed ryougi1201 closed 9 months ago

ryougi1201 commented 10 months ago

Hi authors,

Thanks for this amazing works. May you provide the exactly camera poses for 12 rendered images or the rendering code?

Thank you so much!

Colin97 commented 9 months ago

Hi @ryougi1201 , Sorry for the late reply.

You can find the camera poses here:

def sample_camera_loc(phi=None, theta=None, r=3.5):
    x = r * np.sin(phi) * np.cos(theta)
    y = r * np.sin(phi) * np.sin(theta)
    z = r * np.cos(phi)
    return np.array([x, y, z])

views = [[np.pi / 3, np.pi / 6],
         [np.pi / 3, np.pi / 6 * 4],
         [np.pi / 3, np.pi / 6 * 7], 
         [np.pi / 3, np.pi / 6 * 10], 
         [np.pi / 2, np.pi / 6 * 2],
         [np.pi / 2, np.pi / 6 * 5],
         [np.pi / 2, np.pi / 6 * 8],
         [np.pi / 2, np.pi / 6 * 11],
         [np.pi / 3 * 2, 0],
         [np.pi / 3 * 2, np.pi / 2],
         [np.pi / 3 * 2, np.pi],
         [np.pi / 3 * 2, np.pi / 2 * 3]]

for i in range(12):
    location = sample_camera_loc(views[i][0], views[i][1])
    rotation_matrix = bproc.camera.rotation_from_forward_vec([0,0,0] - location)
    cam2world_matrix = bproc.math.build_transformation_mat(location, rotation_matrix)
    bproc.camera.add_camera_pose(cam2world_matrix)
ganchaofan0000 commented 6 months ago

Could you provide the code of rendering 12 images from pt

Colin97 commented 6 months ago

Please see here.