Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Make tf.browser.fromPixels / toPixels and route tf.fromPixels / tf.toPixels to it. #1540

Merged
merged 7 commits into from
Feb 6, 2019

Conversation

nsthorat
Copy link
Contributor

@nsthorat nsthorat commented Feb 5, 2019

We will delete tf.fromPixels in the 1.0 branch.

Fixes tensorflow/tfjs#669


This change is Reviewable

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Thanks, A high level question, what is the mechanism for a different env (node, wechat) to provide its own custom op (i.e. wechat.fromPixels) op and be able to attach to the tf namespace.

Reviewed 7 of 7 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @nsthorat)


src/ops/browser.ts, line 26 at r1 (raw file):

 *
 * ```js
 * const image = new ImageData(1, 1);

ImageData(2,2) ?

Copy link
Contributor Author

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

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

wechat will have it's own package entirely so can provide a separate API (outside browser.fromPixels)

node will have decodeJpeg (not use fromPixels)

Reviewable status: 0 of 1 approvals obtained (waiting on @pyu10055)


src/ops/browser.ts, line 26 at r1 (raw file):

Previously, pyu10055 (Ping Yu) wrote…

ImageData(2,2) ?

This is a 1x1 image (single value, 4 values of rgba)

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

My question since the PR to create a browser namespace for set of ops, what is way to adding other platform specific ops. Should we allow registering custom ops in engine so the ops can get to routed to the custom backend who implements them?

Reviewable status: 0 of 1 approvals obtained (waiting on @pyu10055)

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 approvals obtained


src/ops/browser.ts, line 26 at r1 (raw file):

Previously, nsthorat (Nikhil Thorat) wrote…

This is a 1x1 image (single value, 4 values of rgba)

ah, right.

Copy link
Contributor Author

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

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

For now we're not going to tackle platform registration since wechat can have its own library (it will add quite a bit of complexity). We can talk about that offline, but this PR should be unrelated.

Reviewable status: 0 of 1 approvals obtained

@nsthorat nsthorat requested a review from dsmilkov February 5, 2019 20:45
Copy link
Contributor

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 7 files at r1, 2 of 3 files at r2.
Reviewable status: 0 of 1 approvals obtained (waiting on @dsmilkov and @nsthorat)


src/ops/browser.ts, line 41 at r2 (raw file):

 * 3 (ignores alpha channel of input image).
 */
/** @doc {heading: 'Tensors', subheading: 'Creation', namespace: 'browser'} */

let's have this under the section 'Browser'.


src/ops/browser.ts, line 42 at r2 (raw file):

 */
/** @doc {heading: 'Tensors', subheading: 'Creation', namespace: 'browser'} */
function fromPixels_(

move toPixels also to browser

Copy link
Contributor Author

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 approvals obtained


src/ops/browser.ts, line 42 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

move toPixels also to browser

Done.

Copy link
Contributor

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r2, 3 of 3 files at r3.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@nsthorat nsthorat merged commit c60a337 into master Feb 6, 2019
@nsthorat nsthorat deleted the frompixels branch February 6, 2019 04:29
@nsthorat nsthorat changed the title Make tf.browser.fromPixels and route tf.fromPixels to it. Make tf.browser.fromPixels / toPixels and route tf.fromPixels / tf.toPixels to it. Feb 6, 2019
nsthorat pushed a commit that referenced this pull request Feb 6, 2019
…e tf.fromPixels / tf.toPixels to it. (#1545)

This is a cherry pick to 0.15.x of #1540
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants