Merge pull request #4829 from priankakariatyml:ios-vision-api-name-changes
PiperOrigin-RevId: 568622587
This commit is contained in:
commit
0417817886
|
@ -109,7 +109,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
MPPImage *mppImage = [self imageWithFileInfo:kCatImage];
|
MPPImage *mppImage = [self imageWithFileInfo:kCatImage];
|
||||||
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectInImage:mppImage error:&error];
|
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectImage:mppImage error:&error];
|
||||||
XCTAssertNil(error);
|
XCTAssertNil(error);
|
||||||
XCTAssertNotNil(faceDetectorResult);
|
XCTAssertNotNil(faceDetectorResult);
|
||||||
XCTAssertEqual(faceDetectorResult.detections.count, 0);
|
XCTAssertEqual(faceDetectorResult.detections.count, 0);
|
||||||
|
@ -125,7 +125,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectInVideoFrame:image
|
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:i
|
timestampInMilliseconds:i
|
||||||
error:nil];
|
error:nil];
|
||||||
[self assertFaceDetectorResult:faceDetectorResult
|
[self assertFaceDetectorResult:faceDetectorResult
|
||||||
|
@ -141,7 +141,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitRotatedImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitRotatedImage];
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectInVideoFrame:image
|
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:i
|
timestampInMilliseconds:i
|
||||||
error:nil];
|
error:nil];
|
||||||
[self assertFaceDetectorResult:faceDetectorResult
|
[self assertFaceDetectorResult:faceDetectorResult
|
||||||
|
@ -181,7 +181,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < iterationCount; i++) {
|
for (int i = 0; i < iterationCount; i++) {
|
||||||
XCTAssertTrue([faceDetector detectAsyncInImage:image timestampInMilliseconds:i error:nil]);
|
XCTAssertTrue([faceDetector detectAsyncImage:image timestampInMilliseconds:i error:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSTimeInterval timeout = 0.5f;
|
NSTimeInterval timeout = 0.5f;
|
||||||
|
@ -205,10 +205,10 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
};
|
};
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
XCTAssertTrue([faceDetector detectAsyncInImage:image timestampInMilliseconds:1 error:nil]);
|
XCTAssertTrue([faceDetector detectAsyncImage:image timestampInMilliseconds:1 error:nil]);
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
XCTAssertFalse([faceDetector detectAsyncInImage:image timestampInMilliseconds:0 error:&error]);
|
XCTAssertFalse([faceDetector detectAsyncImage:image timestampInMilliseconds:0 error:&error]);
|
||||||
|
|
||||||
NSError *expectedError =
|
NSError *expectedError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -274,7 +274,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectAsyncInImage:image
|
XCTAssertFalse([faceDetector detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectInVideoFrame:image
|
XCTAssertFalse([faceDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectAsyncInImage:image
|
XCTAssertFalse([faceDetector detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([faceDetector detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -350,7 +350,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([faceDetector detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -362,7 +362,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([faceDetector detectInVideoFrame:image
|
XCTAssertFalse([faceDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
for (int i = 0; i < iterationCount; i++) {
|
for (int i = 0; i < iterationCount; i++) {
|
||||||
XCTAssertTrue([faceDetector detectAsyncInImage:image timestampInMilliseconds:i error:nil]);
|
XCTAssertTrue([faceDetector detectAsyncImage:image timestampInMilliseconds:i error:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSTimeInterval timeout = 0.5f;
|
NSTimeInterval timeout = 0.5f;
|
||||||
|
@ -503,7 +503,7 @@ static const float kKeypointErrorThreshold = 1e-2;
|
||||||
usingFaceDetector:(MPPFaceDetector *)faceDetector
|
usingFaceDetector:(MPPFaceDetector *)faceDetector
|
||||||
containsExpectedKeypoints:(NSArray<NSArray *> *)expectedKeypoints {
|
containsExpectedKeypoints:(NSArray<NSArray *> *)expectedKeypoints {
|
||||||
NSError *error;
|
NSError *error;
|
||||||
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectInImage:mppImage error:&error];
|
MPPFaceDetectorResult *faceDetectorResult = [faceDetector detectImage:mppImage error:&error];
|
||||||
XCTAssertNil(error);
|
XCTAssertNil(error);
|
||||||
XCTAssertNotNil(faceDetectorResult);
|
XCTAssertNotNil(faceDetectorResult);
|
||||||
[self assertFaceDetectorResult:faceDetectorResult containsExpectedKeypoints:expectedKeypoints];
|
[self assertFaceDetectorResult:faceDetectorResult containsExpectedKeypoints:expectedKeypoints];
|
||||||
|
|
|
@ -137,7 +137,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
MPPImage *mppImage = [self imageWithFileInfo:kCatImage];
|
MPPImage *mppImage = [self imageWithFileInfo:kCatImage];
|
||||||
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectInImage:mppImage
|
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectImage:mppImage
|
||||||
error:&error];
|
error:&error];
|
||||||
XCTAssertNil(error);
|
XCTAssertNil(error);
|
||||||
XCTAssertNotNil(faceLandmarkerResult);
|
XCTAssertNotNil(faceLandmarkerResult);
|
||||||
|
@ -158,7 +158,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
NSArray<MPPNormalizedLandmark *> *expectedLandmarks =
|
NSArray<MPPNormalizedLandmark *> *expectedLandmarks =
|
||||||
[MPPFaceLandmarkerTests expectedLandmarksFromFileInfo:kPortraitExpectedLandmarksName];
|
[MPPFaceLandmarkerTests expectedLandmarksFromFileInfo:kPortraitExpectedLandmarksName];
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectInVideoFrame:image
|
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:i
|
timestampInMilliseconds:i
|
||||||
error:nil];
|
error:nil];
|
||||||
[self assertFaceLandmarkerResult:faceLandmarkerResult
|
[self assertFaceLandmarkerResult:faceLandmarkerResult
|
||||||
|
@ -200,7 +200,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < iterationCount; i++) {
|
for (int i = 0; i < iterationCount; i++) {
|
||||||
XCTAssertTrue([faceLandmarker detectAsyncInImage:image timestampInMilliseconds:i error:nil]);
|
XCTAssertTrue([faceLandmarker detectAsyncImage:image timestampInMilliseconds:i error:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSTimeInterval timeout = 0.5f;
|
NSTimeInterval timeout = 0.5f;
|
||||||
|
@ -224,10 +224,10 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
};
|
};
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
XCTAssertTrue([faceLandmarker detectAsyncInImage:image timestampInMilliseconds:1 error:nil]);
|
XCTAssertTrue([faceLandmarker detectAsyncImage:image timestampInMilliseconds:1 error:nil]);
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
XCTAssertFalse([faceLandmarker detectAsyncInImage:image timestampInMilliseconds:0 error:&error]);
|
XCTAssertFalse([faceLandmarker detectAsyncImage:image timestampInMilliseconds:0 error:&error]);
|
||||||
|
|
||||||
NSError *expectedError =
|
NSError *expectedError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -292,7 +292,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
|
|
||||||
NSError *liveStreamAPICallError;
|
NSError *liveStreamAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectAsyncInImage:image
|
XCTAssertFalse([faceLandmarker detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamAPICallError]);
|
error:&liveStreamAPICallError]);
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
AssertEqualErrors(liveStreamAPICallError, expectedLiveStreamAPICallError);
|
AssertEqualErrors(liveStreamAPICallError, expectedLiveStreamAPICallError);
|
||||||
|
|
||||||
NSError *videoAPICallError;
|
NSError *videoAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectInVideoFrame:image
|
XCTAssertFalse([faceLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoAPICallError]);
|
error:&videoAPICallError]);
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
NSError *liveStreamAPICallError;
|
NSError *liveStreamAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectAsyncInImage:image
|
XCTAssertFalse([faceLandmarker detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamAPICallError]);
|
error:&liveStreamAPICallError]);
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
AssertEqualErrors(liveStreamAPICallError, expectedLiveStreamAPICallError);
|
AssertEqualErrors(liveStreamAPICallError, expectedLiveStreamAPICallError);
|
||||||
|
|
||||||
NSError *imageAPICallError;
|
NSError *imageAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectInImage:image error:&imageAPICallError]);
|
XCTAssertFalse([faceLandmarker detectImage:image error:&imageAPICallError]);
|
||||||
|
|
||||||
NSError *expectedImageAPICallError =
|
NSError *expectedImageAPICallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -365,7 +365,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
MPPImage *image = [self imageWithFileInfo:kPortraitImage];
|
||||||
|
|
||||||
NSError *imageAPICallError;
|
NSError *imageAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectInImage:image error:&imageAPICallError]);
|
XCTAssertFalse([faceLandmarker detectImage:image error:&imageAPICallError]);
|
||||||
|
|
||||||
NSError *expectedImageAPICallError =
|
NSError *expectedImageAPICallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -377,7 +377,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
AssertEqualErrors(imageAPICallError, expectedImageAPICallError);
|
AssertEqualErrors(imageAPICallError, expectedImageAPICallError);
|
||||||
|
|
||||||
NSError *videoAPICallError;
|
NSError *videoAPICallError;
|
||||||
XCTAssertFalse([faceLandmarker detectInVideoFrame:image
|
XCTAssertFalse([faceLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoAPICallError]);
|
error:&videoAPICallError]);
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expectedTransformationMatrix == NULL) {
|
if (expectedTransformationMatrix == nullptr) {
|
||||||
XCTAssertEqualObjects(faceLandmarkerResult.facialTransformationMatrixes, [NSArray array]);
|
XCTAssertEqualObjects(faceLandmarkerResult.facialTransformationMatrixes, [NSArray array]);
|
||||||
} else {
|
} else {
|
||||||
MPPTransformMatrix *actualTransformationMatrix =
|
MPPTransformMatrix *actualTransformationMatrix =
|
||||||
|
@ -539,7 +539,7 @@ constexpr float kFacialTransformationMatrixErrorThreshold = 0.2f;
|
||||||
MPPImage *mppImage = [self imageWithFileInfo:fileInfo];
|
MPPImage *mppImage = [self imageWithFileInfo:fileInfo];
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectInImage:mppImage
|
MPPFaceLandmarkerResult *faceLandmarkerResult = [faceLandmarker detectImage:mppImage
|
||||||
error:&error];
|
error:&error];
|
||||||
XCTAssertNil(error);
|
XCTAssertNil(error);
|
||||||
XCTAssertNotNil(faceLandmarkerResult);
|
XCTAssertNotNil(faceLandmarkerResult);
|
||||||
|
|
|
@ -208,10 +208,10 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPPHandLandmarkerResult *)detectInImageWithFileInfo:(ResourceFileInfo *)imageFileInfo
|
- (MPPHandLandmarkerResult *)detectImageWithFileInfo:(ResourceFileInfo *)imageFileInfo
|
||||||
usingHandLandmarker:(MPPHandLandmarker *)handLandmarker {
|
usingHandLandmarker:(MPPHandLandmarker *)handLandmarker {
|
||||||
MPPImage *mppImage = [self imageWithFileInfo:imageFileInfo];
|
MPPImage *mppImage = [self imageWithFileInfo:imageFileInfo];
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectInImage:mppImage error:nil];
|
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectImage:mppImage error:nil];
|
||||||
XCTAssertNotNil(handLandmarkerResult);
|
XCTAssertNotNil(handLandmarkerResult);
|
||||||
|
|
||||||
return handLandmarkerResult;
|
return handLandmarkerResult;
|
||||||
|
@ -221,7 +221,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
usingHandLandmarker:(MPPHandLandmarker *)handLandmarker
|
usingHandLandmarker:(MPPHandLandmarker *)handLandmarker
|
||||||
approximatelyEqualsHandLandmarkerResult:
|
approximatelyEqualsHandLandmarkerResult:
|
||||||
(MPPHandLandmarkerResult *)expectedHandLandmarkerResult {
|
(MPPHandLandmarkerResult *)expectedHandLandmarkerResult {
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [self detectInImageWithFileInfo:fileInfo
|
MPPHandLandmarkerResult *handLandmarkerResult = [self detectImageWithFileInfo:fileInfo
|
||||||
usingHandLandmarker:handLandmarker];
|
usingHandLandmarker:handLandmarker];
|
||||||
[self assertHandLandmarkerResult:handLandmarkerResult
|
[self assertHandLandmarkerResult:handLandmarkerResult
|
||||||
isApproximatelyEqualToExpectedResult:expectedHandLandmarkerResult];
|
isApproximatelyEqualToExpectedResult:expectedHandLandmarkerResult];
|
||||||
|
@ -249,7 +249,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPHandLandmarker *handLandmarker =
|
MPPHandLandmarker *handLandmarker =
|
||||||
[self createHandLandmarkerWithOptionsSucceeds:handLandmarkerOptions];
|
[self createHandLandmarkerWithOptionsSucceeds:handLandmarkerOptions];
|
||||||
|
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [self detectInImageWithFileInfo:kNoHandsImage
|
MPPHandLandmarkerResult *handLandmarkerResult = [self detectImageWithFileInfo:kNoHandsImage
|
||||||
usingHandLandmarker:handLandmarker];
|
usingHandLandmarker:handLandmarker];
|
||||||
AssertHandLandmarkerResultIsEmpty(handLandmarkerResult);
|
AssertHandLandmarkerResultIsEmpty(handLandmarkerResult);
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPHandLandmarker *handLandmarker =
|
MPPHandLandmarker *handLandmarker =
|
||||||
[self createHandLandmarkerWithOptionsSucceeds:handLandmarkerOptions];
|
[self createHandLandmarkerWithOptionsSucceeds:handLandmarkerOptions];
|
||||||
|
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [self detectInImageWithFileInfo:kTwoHandsImage
|
MPPHandLandmarkerResult *handLandmarkerResult = [self detectImageWithFileInfo:kTwoHandsImage
|
||||||
usingHandLandmarker:handLandmarker];
|
usingHandLandmarker:handLandmarker];
|
||||||
|
|
||||||
XCTAssertTrue(handLandmarkerResult.handedness.count == numHands);
|
XCTAssertTrue(handLandmarkerResult.handedness.count == numHands);
|
||||||
|
@ -280,7 +280,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *mppImage = [self imageWithFileInfo:kPointingUpRotatedImage
|
MPPImage *mppImage = [self imageWithFileInfo:kPointingUpRotatedImage
|
||||||
orientation:UIImageOrientationRight];
|
orientation:UIImageOrientationRight];
|
||||||
|
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectInImage:mppImage error:nil];
|
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectImage:mppImage error:nil];
|
||||||
|
|
||||||
[self assertHandLandmarkerResult:handLandmarkerResult
|
[self assertHandLandmarkerResult:handLandmarkerResult
|
||||||
isApproximatelyEqualToExpectedResult:[MPPHandLandmarkerTests
|
isApproximatelyEqualToExpectedResult:[MPPHandLandmarkerTests
|
||||||
|
@ -339,7 +339,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectAsyncInImage:image
|
XCTAssertFalse([handLandmarker detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectInVideoFrame:image
|
XCTAssertFalse([handLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectAsyncInImage:image
|
XCTAssertFalse([handLandmarker detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([handLandmarker detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -416,7 +416,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([handLandmarker detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -428,7 +428,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([handLandmarker detectInVideoFrame:image
|
XCTAssertFalse([handLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectInVideoFrame:image
|
MPPHandLandmarkerResult *handLandmarkerResult = [handLandmarker detectVideoFrame:image
|
||||||
timestampInMilliseconds:i
|
timestampInMilliseconds:i
|
||||||
error:nil];
|
error:nil];
|
||||||
[self assertHandLandmarkerResult:handLandmarkerResult
|
[self assertHandLandmarkerResult:handLandmarkerResult
|
||||||
|
@ -480,10 +480,10 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
XCTAssertTrue([handLandmarker detectAsyncInImage:image timestampInMilliseconds:1 error:nil]);
|
XCTAssertTrue([handLandmarker detectAsyncImage:image timestampInMilliseconds:1 error:nil]);
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
XCTAssertFalse([handLandmarker detectAsyncInImage:image timestampInMilliseconds:0 error:&error]);
|
XCTAssertFalse([handLandmarker detectAsyncImage:image timestampInMilliseconds:0 error:&error]);
|
||||||
|
|
||||||
NSError *expectedError =
|
NSError *expectedError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -533,7 +533,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
MPPImage *image = [self imageWithFileInfo:kThumbUpImage];
|
||||||
|
|
||||||
for (int i = 0; i < iterationCount; i++) {
|
for (int i = 0; i < iterationCount; i++) {
|
||||||
XCTAssertTrue([handLandmarker detectAsyncInImage:image timestampInMilliseconds:i error:nil]);
|
XCTAssertTrue([handLandmarker detectAsyncImage:image timestampInMilliseconds:i error:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSTimeInterval timeout = 0.5f;
|
NSTimeInterval timeout = 0.5f;
|
||||||
|
|
|
@ -194,7 +194,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
usingObjectDetector:(MPPObjectDetector *)objectDetector
|
usingObjectDetector:(MPPObjectDetector *)objectDetector
|
||||||
maxResults:(NSInteger)maxResults
|
maxResults:(NSInteger)maxResults
|
||||||
equalsObjectDetectorResult:(MPPObjectDetectorResult *)expectedObjectDetectorResult {
|
equalsObjectDetectorResult:(MPPObjectDetectorResult *)expectedObjectDetectorResult {
|
||||||
MPPObjectDetectorResult *ObjectDetectorResult = [objectDetector detectInImage:mppImage error:nil];
|
MPPObjectDetectorResult *ObjectDetectorResult = [objectDetector detectImage:mppImage error:nil];
|
||||||
|
|
||||||
[self assertObjectDetectorResult:ObjectDetectorResult
|
[self assertObjectDetectorResult:ObjectDetectorResult
|
||||||
isEqualToExpectedResult:expectedObjectDetectorResult
|
isEqualToExpectedResult:expectedObjectDetectorResult
|
||||||
|
@ -495,7 +495,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectAsyncInImage:image
|
XCTAssertFalse([objectDetector detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectInVideoFrame:image
|
XCTAssertFalse([objectDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
NSError *liveStreamApiCallError;
|
NSError *liveStreamApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectAsyncInImage:image
|
XCTAssertFalse([objectDetector detectAsyncImage:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&liveStreamApiCallError]);
|
error:&liveStreamApiCallError]);
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
AssertEqualErrors(liveStreamApiCallError, expectedLiveStreamApiCallError);
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([objectDetector detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -571,7 +571,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
NSError *imageApiCallError;
|
NSError *imageApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectInImage:image error:&imageApiCallError]);
|
XCTAssertFalse([objectDetector detectImage:image error:&imageApiCallError]);
|
||||||
|
|
||||||
NSError *expectedImageApiCallError =
|
NSError *expectedImageApiCallError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -583,7 +583,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
AssertEqualErrors(imageApiCallError, expectedImageApiCallError);
|
||||||
|
|
||||||
NSError *videoApiCallError;
|
NSError *videoApiCallError;
|
||||||
XCTAssertFalse([objectDetector detectInVideoFrame:image
|
XCTAssertFalse([objectDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:0
|
timestampInMilliseconds:0
|
||||||
error:&videoApiCallError]);
|
error:&videoApiCallError]);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
MPPObjectDetectorResult *ObjectDetectorResult = [objectDetector detectInVideoFrame:image
|
MPPObjectDetectorResult *ObjectDetectorResult = [objectDetector detectVideoFrame:image
|
||||||
timestampInMilliseconds:i
|
timestampInMilliseconds:i
|
||||||
error:nil];
|
error:nil];
|
||||||
|
|
||||||
|
@ -643,10 +643,10 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
|
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
XCTAssertTrue([objectDetector detectAsyncInImage:image timestampInMilliseconds:1 error:nil]);
|
XCTAssertTrue([objectDetector detectAsyncImage:image timestampInMilliseconds:1 error:nil]);
|
||||||
|
|
||||||
NSError *error;
|
NSError *error;
|
||||||
XCTAssertFalse([objectDetector detectAsyncInImage:image timestampInMilliseconds:0 error:&error]);
|
XCTAssertFalse([objectDetector detectAsyncImage:image timestampInMilliseconds:0 error:&error]);
|
||||||
|
|
||||||
NSError *expectedError =
|
NSError *expectedError =
|
||||||
[NSError errorWithDomain:kExpectedErrorDomain
|
[NSError errorWithDomain:kExpectedErrorDomain
|
||||||
|
@ -702,7 +702,7 @@ static NSString *const kLiveStreamTestsDictExpectationKey = @"expectation";
|
||||||
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
MPPImage *image = [self imageWithFileInfo:kCatsAndDogsImage];
|
||||||
|
|
||||||
for (int i = 0; i < iterationCount; i++) {
|
for (int i = 0; i < iterationCount; i++) {
|
||||||
XCTAssertTrue([objectDetector detectAsyncInImage:image timestampInMilliseconds:i error:nil]);
|
XCTAssertTrue([objectDetector detectAsyncImage:image timestampInMilliseconds:i error:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSTimeInterval timeout = 0.5f;
|
NSTimeInterval timeout = 0.5f;
|
||||||
|
|
|
@ -100,7 +100,7 @@ NS_SWIFT_NAME(FaceDetector)
|
||||||
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
||||||
* image data.
|
* image data.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPFaceDetectorResult *)detectInImage:(MPPImage *)image
|
- (nullable MPPFaceDetectorResult *)detectImage:(MPPImage *)image
|
||||||
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,7 +127,7 @@ NS_SWIFT_NAME(FaceDetector)
|
||||||
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
||||||
* image data.
|
* image data.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPFaceDetectorResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPFaceDetectorResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
||||||
|
@ -165,7 +165,7 @@ NS_SWIFT_NAME(FaceDetector)
|
||||||
*
|
*
|
||||||
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
||||||
|
|
|
@ -130,13 +130,13 @@ static NSString *const kTaskName = @"faceDetector";
|
||||||
return [self initWithOptions:options error:error];
|
return [self initWithOptions:options error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPFaceDetectorResult *)detectInImage:(MPPImage *)image error:(NSError **)error {
|
- (nullable MPPFaceDetectorResult *)detectImage:(MPPImage *)image error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
||||||
|
|
||||||
return [MPPFaceDetector faceDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPFaceDetector faceDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPFaceDetectorResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPFaceDetectorResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap =
|
std::optional<PacketMap> outputPacketMap =
|
||||||
|
@ -147,7 +147,7 @@ static NSString *const kTaskName = @"faceDetector";
|
||||||
return [MPPFaceDetector faceDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPFaceDetector faceDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
return [_visionTaskRunner processLiveStreamImage:image
|
return [_visionTaskRunner processLiveStreamImage:image
|
||||||
|
|
|
@ -71,7 +71,7 @@ NS_SWIFT_NAME(FaceLandmarker)
|
||||||
* @return An `FaceLandmarkerResult` that contains a list of landmarks. `nil` if there is an error
|
* @return An `FaceLandmarkerResult` that contains a list of landmarks. `nil` if there is an error
|
||||||
* in initializing the face landmaker.
|
* in initializing the face landmaker.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPFaceLandmarkerResult *)detectInImage:(MPPImage *)image
|
- (nullable MPPFaceLandmarkerResult *)detectImage:(MPPImage *)image
|
||||||
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,7 +95,7 @@ NS_SWIFT_NAME(FaceLandmarker)
|
||||||
* @return An `FaceLandmarkerResult` that contains a list of landmarks. `nil` if there is an
|
* @return An `FaceLandmarkerResult` that contains a list of landmarks. `nil` if there is an
|
||||||
* error in initializing the face landmaker.
|
* error in initializing the face landmaker.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPFaceLandmarkerResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPFaceLandmarkerResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
||||||
|
@ -132,7 +132,7 @@ NS_SWIFT_NAME(FaceLandmarker)
|
||||||
*
|
*
|
||||||
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
||||||
|
|
|
@ -154,13 +154,13 @@ static NSString *const kTaskName = @"faceLandmarker";
|
||||||
return [self initWithOptions:options error:error];
|
return [self initWithOptions:options error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPFaceLandmarkerResult *)detectInImage:(MPPImage *)image error:(NSError **)error {
|
- (nullable MPPFaceLandmarkerResult *)detectImage:(MPPImage *)image error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
||||||
|
|
||||||
return [MPPFaceLandmarker faceLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPFaceLandmarker faceLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPFaceLandmarkerResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPFaceLandmarkerResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap =
|
std::optional<PacketMap> outputPacketMap =
|
||||||
|
@ -171,7 +171,7 @@ static NSString *const kTaskName = @"faceLandmarker";
|
||||||
return [MPPFaceLandmarker faceLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPFaceLandmarker faceLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
return [_visionTaskRunner processLiveStreamImage:image
|
return [_visionTaskRunner processLiveStreamImage:image
|
||||||
|
|
|
@ -146,7 +146,7 @@ NS_SWIFT_NAME(HandLandmarker)
|
||||||
* @return An `HandLandmarkerResult` object that contains the hand hand landmarks detection
|
* @return An `HandLandmarkerResult` object that contains the hand hand landmarks detection
|
||||||
* results.
|
* results.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPHandLandmarkerResult *)detectInImage:(MPPImage *)image
|
- (nullable MPPHandLandmarkerResult *)detectImage:(MPPImage *)image
|
||||||
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,7 +176,7 @@ NS_SWIFT_NAME(HandLandmarker)
|
||||||
* @return An `HandLandmarkerResult` object that contains the hand hand landmarks detection
|
* @return An `HandLandmarkerResult` object that contains the hand hand landmarks detection
|
||||||
* results.
|
* results.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPHandLandmarkerResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPHandLandmarkerResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
||||||
|
@ -216,7 +216,7 @@ NS_SWIFT_NAME(HandLandmarker)
|
||||||
*
|
*
|
||||||
* @return `YES` if the image was sent to the task successfully, otherwise `NO`.
|
* @return `YES` if the image was sent to the task successfully, otherwise `NO`.
|
||||||
*/
|
*/
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
||||||
|
|
|
@ -140,13 +140,13 @@ static NSString *const kTaskName = @"handLandmarker";
|
||||||
return [self initWithOptions:options error:error];
|
return [self initWithOptions:options error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPHandLandmarkerResult *)detectInImage:(MPPImage *)image error:(NSError **)error {
|
- (nullable MPPHandLandmarkerResult *)detectImage:(MPPImage *)image error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
||||||
|
|
||||||
return [MPPHandLandmarker handLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPHandLandmarker handLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPHandLandmarkerResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPHandLandmarkerResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap =
|
std::optional<PacketMap> outputPacketMap =
|
||||||
|
@ -157,7 +157,7 @@ static NSString *const kTaskName = @"handLandmarker";
|
||||||
return [MPPHandLandmarker handLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPHandLandmarker handLandmarkerResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
return [_visionTaskRunner processLiveStreamImage:image
|
return [_visionTaskRunner processLiveStreamImage:image
|
||||||
|
|
|
@ -112,7 +112,7 @@ NS_SWIFT_NAME(ObjectDetector)
|
||||||
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
||||||
* image data.
|
* image data.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPObjectDetectorResult *)detectInImage:(MPPImage *)image
|
- (nullable MPPObjectDetectorResult *)detectImage:(MPPImage *)image
|
||||||
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
error:(NSError **)error NS_SWIFT_NAME(detect(image:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,7 +138,7 @@ NS_SWIFT_NAME(ObjectDetector)
|
||||||
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
* system, i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions of the underlying
|
||||||
* image data.
|
* image data.
|
||||||
*/
|
*/
|
||||||
- (nullable MPPObjectDetectorResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPObjectDetectorResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detect(videoFrame:timestampInMilliseconds:));
|
||||||
|
@ -176,7 +176,7 @@ NS_SWIFT_NAME(ObjectDetector)
|
||||||
*
|
*
|
||||||
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
* @return `true` if the image was sent to the task successfully, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error
|
error:(NSError **)error
|
||||||
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
NS_SWIFT_NAME(detectAsync(image:timestampInMilliseconds:));
|
||||||
|
|
|
@ -128,13 +128,13 @@ static NSString *const kTaskName = @"objectDetector";
|
||||||
return [self initWithOptions:options error:error];
|
return [self initWithOptions:options error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPObjectDetectorResult *)detectInImage:(MPPImage *)image error:(NSError **)error {
|
- (nullable MPPObjectDetectorResult *)detectImage:(MPPImage *)image error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
std::optional<PacketMap> outputPacketMap = [_visionTaskRunner processImage:image error:error];
|
||||||
|
|
||||||
return [MPPObjectDetector objectDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPObjectDetector objectDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable MPPObjectDetectorResult *)detectInVideoFrame:(MPPImage *)image
|
- (nullable MPPObjectDetectorResult *)detectVideoFrame:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
std::optional<PacketMap> outputPacketMap =
|
std::optional<PacketMap> outputPacketMap =
|
||||||
|
@ -145,7 +145,7 @@ static NSString *const kTaskName = @"objectDetector";
|
||||||
return [MPPObjectDetector objectDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
return [MPPObjectDetector objectDetectorResultWithOptionalOutputPacketMap:outputPacketMap];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)detectAsyncInImage:(MPPImage *)image
|
- (BOOL)detectAsyncImage:(MPPImage *)image
|
||||||
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
timestampInMilliseconds:(NSInteger)timestampInMilliseconds
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
return [_visionTaskRunner processLiveStreamImage:image
|
return [_visionTaskRunner processLiveStreamImage:image
|
||||||
|
|
Loading…
Reference in New Issue
Block a user