-
Notifications
You must be signed in to change notification settings - Fork 147
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
Replace TensorFlow image loading with stb_image #429
Conversation
i think this is a good pragmatic way to get away from raw ops |
…entationOnly, update with Saleem's suggestions.
Looks good. |
import TensorFlow | ||
|
||
final class ImageTests: XCTestCase { | ||
let resourceBaseLocation = URL(fileURLWithPath: #file).deletingLastPathComponent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will #file
break in the forthcoming changes to not be full paths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, it probably will. It looks like we have access to #filePath
in our toolchain (I wasn't sure if we did), so I'll switch this and our other uses of #file
to #filePath
in anticipation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #449 is my quick fix to address this.
As part of our efforts to reduce our dependencies on TensorFlow libraries, this replaces the image saving and loading routines with ones provided by the stb_image C single headers. This is inspired by t-ae's cross-platform image loading library Swim. We're evaluating various image processing options, so this isn't guaranteed to be a permanent implementation, but it works well for our use cases right now.
The interface to the Image type has intentionally been left the same as it was before, in order to restrict all code changes to just Image.swift. I'll follow on with some modifications to the API in a later PR.
This is the last change needed to close out issue #225.