Updated iOS vision tasks to use new methods from vision task runner
This commit is contained in:
parent
164eae8c16
commit
117bb507e6
|
@ -166,10 +166,9 @@ static const int kMicroSecondsPerMilliSecond = 1000;
|
|||
regionOfInterest:(CGRect)roi
|
||||
error:(NSError **)error {
|
||||
std::optional<NormalizedRect> rect =
|
||||
[_visionTaskRunner normalizedRectFromRegionOfInterest:roi
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
[_visionTaskRunner normalizedRectWithRegionOfInterest:roi
|
||||
imageOrientation:image.orientation
|
||||
ROIAllowed:YES
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
error:error];
|
||||
if (!rect.has_value()) {
|
||||
return nil;
|
||||
|
@ -196,15 +195,18 @@ static const int kMicroSecondsPerMilliSecond = 1000;
|
|||
outputPacketMap.value()[kClassificationsStreamName.cppString]];
|
||||
}
|
||||
|
||||
- (nullable MPPImageClassifierResult *)classifyImage:(MPPImage *)image error:(NSError **)error {
|
||||
return [self classifyImage:image regionOfInterest:CGRectZero error:error];
|
||||
}
|
||||
|
||||
- (std::optional<PacketMap>)inputPacketMapWithMPPImage:(MPPImage *)image
|
||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||
regionOfInterest:(CGRect)roi
|
||||
error:(NSError **)error {
|
||||
std::optional<NormalizedRect> rect =
|
||||
[_visionTaskRunner normalizedRectFromRegionOfInterest:roi
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
[_visionTaskRunner normalizedRectWithRegionOfInterest:roi
|
||||
imageOrientation:image.orientation
|
||||
ROIAllowed:YES
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
error:error];
|
||||
if (!rect.has_value()) {
|
||||
return std::nullopt;
|
||||
|
@ -225,10 +227,6 @@ static const int kMicroSecondsPerMilliSecond = 1000;
|
|||
return inputPacketMap;
|
||||
}
|
||||
|
||||
- (nullable MPPImageClassifierResult *)classifyImage:(MPPImage *)image error:(NSError **)error {
|
||||
return [self classifyImage:image regionOfInterest:CGRectZero error:error];
|
||||
}
|
||||
|
||||
- (nullable MPPImageClassifierResult *)classifyVideoFrame:(MPPImage *)image
|
||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||
regionOfInterest:(CGRect)roi
|
||||
|
|
|
@ -160,10 +160,8 @@ static NSString *const kTaskName = @"objectDetector";
|
|||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||
error:(NSError **)error {
|
||||
std::optional<NormalizedRect> rect =
|
||||
[_visionTaskRunner normalizedRectFromRegionOfInterest:CGRectZero
|
||||
[_visionTaskRunner normalizedRectWithImageOrientation:image.orientation
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
imageOrientation:image.orientation
|
||||
ROIAllowed:NO
|
||||
error:error];
|
||||
if (!rect.has_value()) {
|
||||
return std::nullopt;
|
||||
|
@ -188,10 +186,8 @@ static NSString *const kTaskName = @"objectDetector";
|
|||
regionOfInterest:(CGRect)roi
|
||||
error:(NSError **)error {
|
||||
std::optional<NormalizedRect> rect =
|
||||
[_visionTaskRunner normalizedRectFromRegionOfInterest:roi
|
||||
[_visionTaskRunner normalizedRectWithImageOrientation:image.orientation
|
||||
imageSize:CGSizeMake(image.width, image.height)
|
||||
imageOrientation:image.orientation
|
||||
ROIAllowed:NO
|
||||
error:error];
|
||||
if (!rect.has_value()) {
|
||||
return nil;
|
||||
|
|
Loading…
Reference in New Issue
Block a user