Attention: This MediaPipe Solutions Preview is an early release. Learn more.

mp.packet_getter.get_matrix

Stay organized with collections Save and categorize content based on your preferences.

get_matrix(arg0: mediapipe.python._framework_bindings.packet.Packet) -> numpy.ndarray[numpy.float32[m, n], flags.f_contiguous]

Get the content of a MediaPipe Matrix Packet as a numpy 2d float ndarray.

Args: packet: A MediaPipe Matrix Packet.

Returns: A numpy 2d float ndarray.

Raises: ValueError: If the Packet doesn't contain matrix data.

Examples: packet = mp.packet_creator.create_matrix(2d_array) data = mp.packet_getter.get_matrix(packet)