Updated iOS Image Classifier to reflect new calculation for normalized rect

This commit is contained in:
Prianka Liz Kariat 2023-04-11 18:18:35 +05:30
parent 114a11dc4e
commit 0fcf92d7d5
2 changed files with 9 additions and 7 deletions

View File

@ -387,16 +387,16 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
NSArray<MPPCategory *> *expectedCategories = @[
[[MPPCategory alloc] initWithIndex:934
score:0.622074f
score:0.753852f
categoryName:@"cheeseburger"
displayName:nil],
[[MPPCategory alloc] initWithIndex:963
score:0.051214f
categoryName:@"meat loaf"
displayName:nil],
[[MPPCategory alloc] initWithIndex:925
score:0.048719f
score:0.028609f
categoryName:@"guacamole"
displayName:nil],
[[MPPCategory alloc] initWithIndex:932
score:0.027782f
categoryName:@"bagel"
displayName:nil]
];
@ -420,7 +420,7 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
NSArray<MPPCategory *> *expectedCategories =
@[ [[MPPCategory alloc] initWithIndex:560
score:0.682305f
score:0.604605f
categoryName:@"folding chair"
displayName:nil] ];

View File

@ -120,6 +120,7 @@ static NSString *const kTaskGraphName =
error:(NSError **)error {
std::optional<NormalizedRect> rect =
[_visionTaskRunner normalizedRectFromRegionOfInterest:roi
imageSize:image.size
imageOrientation:image.orientation
ROIAllowed:YES
error:error];
@ -154,6 +155,7 @@ static NSString *const kTaskGraphName =
error:(NSError **)error {
std::optional<NormalizedRect> rect =
[_visionTaskRunner normalizedRectFromRegionOfInterest:roi
imageSize:image.size
imageOrientation:image.orientation
ROIAllowed:YES
error:error];