'How to disable smoothing pose estimation landmarks in mediapipe (Unity plugin)?

I integrated mediapipe in my Unity project using the plugin by homuler. Unfortunately, setting smoothLandmarks = true for the pose estimation (PoseTrackingGraph.cs) does not have an effect.

private SidePacket BuildSidePacket(ImageSource imageSource)
{
    var sidePacket = new SidePacket();

    SetImageTransformationOptions(sidePacket, imageSource);
    sidePacket.Emplace("model_complexity", new IntPacket((int)modelComplexity));
    sidePacket.Emplace("smooth_landmarks", new BoolPacket(smoothLandmarks));

    return sidePacket;
}

So I tried to find hints in the official implementation and directly found matches in the example of the pose_landmark_cpu.pbtxt

# EXAMPLE:
#   node {
#     calculator: "PoseLandmarkCpu"
#     input_side_packet: "MODEL_COMPLEXITY:model_complexity"
#     input_side_packet: "SMOOTH_LANDMARKS:smooth_landmarks"
#     input_side_packet: "ENABLE_SEGMENTATION:enable_segmentation"
#     input_side_packet: "SMOOTH_SEGMENTATION:smooth_segmentation"
#     input_side_packet: "USE_PREV_LANDMARKS:use_prev_landmarks"
#     input_stream: "IMAGE:image"
#     output_stream: "LANDMARKS:pose_landmarks"
#     output_stream: "SEGMENTATION_MASK:segmentation_mask"
#   }

and tried to add input_side_packet: "SMOOTH_LANDMARKS:smooth_landmarks to pose_tracking_cpu.txt used the by the unity plugin. I know this is a different file, but I just tried to eliminate this option. As expected, this did not work.

So I wonder if you have an idea how I can disable smoothing landmarks for pose estimation?
Maybe you can give me a hint where I can change the c++ directly and rebuild the library afterwards.

Thank you in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source