From f1a5c8d549f8a215f9b37ac46a40c477004b5731 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Tue, 19 Sep 2023 20:10:23 +0530 Subject: [PATCH] Fixed formatting in MPPImageSegmenter.mm --- .../image_segmenter/sources/MPPImageSegmenter.mm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mediapipe/tasks/ios/vision/image_segmenter/sources/MPPImageSegmenter.mm b/mediapipe/tasks/ios/vision/image_segmenter/sources/MPPImageSegmenter.mm index dfa8845f2..8fad36671 100644 --- a/mediapipe/tasks/ios/vision/image_segmenter/sources/MPPImageSegmenter.mm +++ b/mediapipe/tasks/ios/vision/image_segmenter/sources/MPPImageSegmenter.mm @@ -243,17 +243,18 @@ using ::mediapipe::tasks::core::PacketsCallback; return; } - // Output packet map is moved to a block variable that will not be deallocated for the lifetime of the `dispatch_async` call. Eventhough masks are not copied, we have to ensure that they are not de allocated before the delegate call completes. + // Output packet map is moved to a block variable that will not be deallocated for the lifetime of + // the `dispatch_async` call. Since masks are not copied, this ensures that they are only + // deallocated after the delegate call completes. __block PacketMap outputPacketMap = std::move(liveStreamResult.value()); if (outputPacketMap[kImageOutStreamName.cppString].IsEmpty()) { return; } - + dispatch_async(_callbackQueue, ^{ - - MPPImageSegmenterResult *result = - [MPPImageSegmenter imageSegmenterResultWithOutputPacketMap:outputPacketMap - shouldCopyMaskPacketData:NO]; + MPPImageSegmenterResult *result = + [MPPImageSegmenter imageSegmenterResultWithOutputPacketMap:outputPacketMap + shouldCopyMaskPacketData:NO]; [self.imageSegmenterLiveStreamDelegate imageSegmenter:self didFinishSegmentationWithResult:result