Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for iOS Image Segmenter methods with completion handlers #4830

Conversation

priankakariatyml
Copy link
Collaborator

No description provided.

@@ -468,6 +468,45 @@ - (void)imageSegmenter:(MPPImageSegmenter *)imageSegmenter
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this method be moved to "Assert Segmenter Results"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get you. This is the delegate method. Is this comment for something else?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this method should be moved out of the section that contains the test methods. I will move it on import.

MPPImageSegmenter *imageSegmenter = [self createImageSegmenterWithOptionsSucceeds:options];

MPPImage *image = [MPPImage imageWithFileInfo:kCatImageFileInfo];
[imageSegmenter segmentImage:image withCompletionHandler:^(MPPImageSegmenterResult *result, NSError *error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't these test need expectation to ensure that these async blocks execute?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Because the method returns only after the completion handler call completes and hence the test gets completed only after the result is returned via the handler. This segment method is synchronous as opposed to the live stream segment method.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that's right. I will add a comment so future me does not forget again.

@priankakariatyml
Copy link
Collaborator Author

@schmidt-sebastian Just a reminder that this PR is not yet merged.

@schmidt-sebastian
Copy link
Collaborator

@schmidt-sebastian Just a reminder that this PR is not yet merged.

Oops :)

@copybara-service copybara-service bot merged commit 830ee09 into google-ai-edge:master Oct 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants