Skip to content

Commit

Permalink
fix: dispose segmentation mask packets (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Dec 16, 2023
1 parent 3b1f0ec commit 370bc5c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,15 @@ private static PoseLandmarkerResult BuildPoseLandmarkerResult(PacketMap outputPa

var poseLandmarksProto = poseLandmarksProtoPacket.Get();
var poseWorldLandmarksProto = outputPackets.At<LandmarkListVectorPacket, List<LandmarkList>>(_POSE_WORLD_LANDMARKS_STREAM_NAME).Get();
var segmentationMasks = outputPackets.At<ImageVectorPacket, List<Image>>(_SEGMENTATION_MASK_STREAM_NAME)?.Get();

List<Image> segmentationMasks = null;
using (var segmentationMaskPacket = outputPackets.At<ImageVectorPacket, List<Image>>(_SEGMENTATION_MASK_STREAM_NAME))
{
if (segmentationMaskPacket != null)
{
segmentationMasks = segmentationMaskPacket.Get();
}
}

return PoseLandmarkerResult.CreateFrom(poseLandmarksProto, poseWorldLandmarksProto, segmentationMasks);
}
Expand Down

0 comments on commit 370bc5c

Please sign in to comment.