(vec)
return rot_mat, translation
Converts 6DoF parameters to rotation matrix (bs,3,3) and translation vector (bs,3,1)
Converts 6DoF parameters to rotation matrix (bs,3,3) and translation vector (bs,3,1)
Converts 6DoF parameters to rotation matrix ( bs 3 3 ) and translation vector ( bs 3 1 )
def pose_vec2rt(vec):
    """Converts 6DoF parameters to rotation matrix (bs,3,3) and translation vector (bs,3,1)"""
    translation = tf.slice(vec, [0, 3], [-1, 3])
    translation = tf.expand_dims(translation, -1)
    rz = tf.slice(vec, [0, 0], [-1, 1])
    ry = tf.slice(vec, [0, 1], [-1, 1])
    rx = tf.slice(vec, [0, 2], [-1, 1])
    rot_mat = euler2mat(rz, ry, rx)
    rot_mat = tf.squeeze(rot_mat, axis=[1])
    return rot_mat, translation
def pose_vec2rt ( vec ) : translation = tf . slice ( vec , [ 0 , 3 ] , [ - 1 , 3 ] ) translation = tf . expand_dims ( translation , - 1 ) rz = tf . slice ( vec , [ 0 , 0 ] , [ - 1 , 1 ] ) ry = tf . slice ( vec , [ 0 , 1 ] , [ - 1 , 1 ] ) rx = tf . slice ( vec , [ 0 , 2 ] , [ - 1 , 1 ] ) rot_mat = euler2mat ( rz , ry , rx ) rot_mat = tf . squeeze ( rot_mat , axis = [ 1 ] ) return rot_mat , translation