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

Camera movements with the rendering tool #43

Open
azadis opened this issue Mar 3, 2023 · 0 comments
Open

Camera movements with the rendering tool #43

azadis opened this issue Mar 3, 2023 · 0 comments

Comments

@azadis
Copy link

azadis commented Mar 3, 2023

Hi,
I am trying to visualize an amass example using its body_pose, root_orient and translation parameters. It looks like the video that I get from the rendering tool has some camera movements. It is not just the body that is moving in the space, but also the camera. I feed all these three parameters as items in the body_params dictionary.
Is that normal to see camera movements here?
`

def render_smpl_params(bm, body_parms, trans=None, rot_body=None, bg_color='white', body_color='neutral'):
  '''
  :param bm: pytorch body model with batch_size 1
  :param pose_body: Nx21x3
  :param trans: Nx3
  :param betas: Nxnum_betas
  :return: N x 400 x 400 x 3
  '''

  imw, imh = 400, 400
  base_trans = [0, 0.5, 3.0]

  mv = MeshViewer(width=imw, height=imh, use_offscreen=True)
  mv.set_cam_trans(base_trans)
  mv.set_background_color(color=bg_color)
  faces = c2c(bm.f)

  v = c2c(bm(**body_parms).v)
  T, num_verts = v.shape[:-1]

  images = []
  for fIdx in range(T):
      verts = v[fIdx]
      if rot_body is not None:
          verts = rotateXYZ(verts, rot_body)
      color_type = body_color

      color = np.ones_like(verts) * np.array(colors[color_type])[None, :]

      mesh = trimesh.base.Trimesh(verts, faces, vertex_colors=num_verts*colors['grey'])
      mv.set_meshes([mesh], 'static')

      rendered = mv.render()
      images.append(rendered)
return np.array(images).reshape(T, imw, imh, 3)`
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

1 participant