Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

EncodeBase64 and DecodeBase64 ops #376

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

vabarbosa
Copy link

@vabarbosa vabarbosa commented Jun 6, 2019

the TF implementation of the pix2pix model which fails conversion because of

`Unsupported Ops: DecodeJpeg, EncodePng, DecodeBase64`

the Open NSFW model also fails conversion with some of the same ops (tensorflow/tfjs#433).

i would like to take the opportunity to implement some of the ops in TensorFlow.js. starting with this pull request for DecodeBase64 and EncodeBase64.

along with this tfjs-converter PR, there is a corresponding PR in tfjs-core (tensorflow/tfjs-core#1779)


This change is Reviewable

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@vabarbosa vabarbosa reopened this Jun 6, 2019
@vabarbosa
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jun 6, 2019
Copy link
Contributor

@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.

Thank you for the contribution! approved with couple minor comments.

@@ -0,0 +1,64 @@
/**
* @license
* Copyright 2018 Google Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

update to 2019 for all files, thanks.

Copy link
Author

Choose a reason for hiding this comment

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

updated (c9ba5f6, fb065c7)

import {Node} from '../types';

import {executeOp} from './string_executor';
// tslint:disable-next-line:max-line-length
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not needed.

Copy link
Author

Choose a reason for hiding this comment

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

removed (c40b65c)

node.op = 'EncodeBase64';
node.attrParams.pad = createBoolAttr(true);
executeOp(node, {input1}, context);

Copy link
Contributor

Choose a reason for hiding this comment

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

remove the empty line here.

Copy link
Author

Choose a reason for hiding this comment

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

done (7663a37)

- per review comment
- per review comment
- per review comment
- per review request
@vabarbosa
Copy link
Author

@pyu10055 thank you, i have made the updates as requested.

Copy link
Contributor

@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.

This change depends on a PR with tfjs-core, will need to wait for tfjs-core merging that first, and publishing a new version.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants