From 1c4be91a3aa6186fc2c88be81559b3da038b327b Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Thu, 23 Mar 2023 18:41:27 +0530 Subject: [PATCH] Fixed stream names in MPPImageClassifier --- .../image_classifier/sources/MPPImageClassifier.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.mm b/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.mm index 0ad79003f..c1c8d656b 100644 --- a/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.mm +++ b/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.mm @@ -36,7 +36,7 @@ static NSString *const kClassificationsTag = @"CLASSIFICATIONS"; static NSString *const kImageInStreamName = @"image_in"; static NSString *const kImageOutStreamName = @"image_out"; static NSString *const kImageTag = @"IMAGE"; -static NSString *const kNormRectName = @"norm_rect_in"; +static NSString *const kNormRectStreamName = @"norm_rect_in"; static NSString *const kNormRectTag = @"NORM_RECT"; static NSString *const kTaskGraphName = @@ -44,7 +44,7 @@ static NSString *const kTaskGraphName = #define InputPacketMap(imagePacket, normalizedRectPacket) \ { \ - {kImageInStreamName.cppString, imagePacket}, { kNormRectName.cppString, normalizedRectPacket } \ + {kImageInStreamName.cppString, imagePacket}, { kNormRectStreamName.cppString, normalizedRectPacket } \ } @interface MPPImageClassifier () { @@ -61,9 +61,13 @@ static NSString *const kTaskGraphName = MPPTaskInfo *taskInfo = [[MPPTaskInfo alloc] initWithTaskGraphName:kTaskGraphName inputStreams:@[ [NSString - stringWithFormat:@"%@:%@", kImageTag, kImageInStreamName] ] + stringWithFormat:@"%@:%@", kImageTag, kImageInStreamName], + [NSString + stringWithFormat:@"%@:%@", kNormRectTag, kNormRectStreamName] ] outputStreams:@[ [NSString stringWithFormat:@"%@:%@", kClassificationsTag, - kClassificationsStreamName] ] + kClassificationsStreamName], + [NSString stringWithFormat:@"%@:%@", kImageTag, + kImageOutStreamName] ] taskOptions:options enableFlowLimiting:NO error:error];