diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/PoseLandmarker/PoseLandmarker.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/PoseLandmarker/PoseLandmarker.cs index 3bfe90e59..2263ae000 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/PoseLandmarker/PoseLandmarker.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/PoseLandmarker/PoseLandmarker.cs @@ -200,7 +200,15 @@ private static PoseLandmarkerResult BuildPoseLandmarkerResult(PacketMap outputPa var poseLandmarksProto = poseLandmarksProtoPacket.Get(); var poseWorldLandmarksProto = outputPackets.At>(_POSE_WORLD_LANDMARKS_STREAM_NAME).Get(); - var segmentationMasks = outputPackets.At>(_SEGMENTATION_MASK_STREAM_NAME)?.Get(); + + List segmentationMasks = null; + using (var segmentationMaskPacket = outputPackets.At>(_SEGMENTATION_MASK_STREAM_NAME)) + { + if (segmentationMaskPacket != null) + { + segmentationMasks = segmentationMaskPacket.Get(); + } + } return PoseLandmarkerResult.CreateFrom(poseLandmarksProto, poseWorldLandmarksProto, segmentationMasks); }