-
Notifications
You must be signed in to change notification settings - Fork 2k
Add image.transform. #4770
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
Add image.transform. #4770
Conversation
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.
Thanks, this would be very useful for image processing pipeline.
Reviewable status: 0 of 1 approvals obtained (waiting on @lina128)
tfjs-backend-cpu/src/kernels/Transform.ts, line 226 at r1 (raw file):
// f(x, yFloor) = (xCeil - x) / (xCeil - xFloor) * f(xFloor, yFloor) // + (x - xFloor) / (xCeil - xFloor) * f(xCeil, yFloor) const valueYFloor =
good to name it valueXYFloor and valueXYCeil, since it is interpolating for x
tfjs-core/src/ops/image/transform.ts, line 32 at r1 (raw file):
* * @param image 4d tensor of shape `[batch, imageHeight, imageWidth, depth]`. * @param transforms Projective transform matrix/matrices. A vector of length
we don't use the term vector, probably call it tensor1d ?
tfjs-core/src/ops/image/transform_test.ts, line 21 at r1 (raw file):
import {expectArraysClose} from '../../test_util'; describeWithFlags('image.transform', BROWSER_ENVS, () => {
it would be good to add test for different fill and interpolation modes
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.
Reviewed 11 of 11 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @lina128)
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.
Reviewed 2 of 2 files at r2.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @lina128)
Add tf addon equivalent image.transform to tfjs (https://www.tensorflow.org/addons/api_docs/python/tfa/image/transform). Helpful for many image processing tasks. This PR only implemented for the cpu and webgl backend.
This change is