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 ability to run ScanViewController with custom images #32

Merged
merged 2 commits into from
Jul 6, 2019

Conversation

kingst
Copy link
Collaborator

@kingst kingst commented Jul 5, 2019

This PR will help us with automated testing by adding two new capabilities:

  • Feed the machine learning algorithm via a caller-specified TestingImageDataSource
  • Show the images as they are processing via showTestingImageView

With these changes in place, app builders can test this library if they run automated tests on real hardware. The reason this only works with real hardware is because of the way Apple handles camera emulation in their simulators (ie they don't).

Copy link
Collaborator

@jaimejiyepark jaimejiyepark left a comment

Choose a reason for hiding this comment

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

What is the advantage/disadvantage of using the realtime camera feed vs. videos of cards for testing?

@@ -31,6 +31,10 @@ import Vision
@objc func skipButton() -> String
}

@objc public protocol TestingImageDataSource {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you give me an example of how this protocol will be used? I read below that it can be used for custom testing but I am still unclear on how it it should be implemented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, checkout Example/CardScan/ViewController.swift, which is part of this PR. It shows how to implement this protocol and how to use it.

@kingst kingst merged commit 6b55cdd into master Jul 6, 2019
@kingst kingst deleted the custom_image_source branch July 6, 2019 09:20
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