mp.packet_creator.create_matrix

create_matrix(matrix: numpy.ndarray[numpy.float32[m, n]], transpose: bool = False) -> mediapipe.python._framework_bindings.packet.Packet

Create a MediaPipe Matrix Packet from a 2d numpy float ndarray.

The method copies data from the input MatrixXf and the returned packet owns a MatrixXf object.

Args: matrix: A 2d numpy float ndarray. transpose: A boolean to indicate if the input matrix needs to be transposed. Default to False.

Returns: A MediaPipe Matrix Packet.

Raises: TypeError: If the input is not a 2d numpy float ndarray.

Examples: packet = mp.packet_creator.create_matrix( np.array([[.1, .2, .3], [.4, .5, .6]]) matrix = mp.packet_getter.get_matrix(packet)