tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

Support for MirrorPad

Open vbardiovskyg opened this issue 7 years ago • 6 comments

We were trying to convert a Magenta -> TF Hub module -> tfjs.

vbardiovskyg avatar Jul 26 '19 07:07 vbardiovskyg

Hi @pyu10055 any plans to support MirrorPad ?

rthadur avatar Aug 29 '19 14:08 rthadur

@rthadur @pyu10055 How to replace MirrorPad in the generated model with other pad

qzcsgs avatar Sep 02 '19 05:09 qzcsgs

Any progress on this issue? We have a model for image processing, MirrorPad handles the borders pretty good so we can't replace it with other pads or work arounds easily as #936.

Or any guide we can add a custom op to tensorflowjs? I'd like to give it a try if tensorflowjs has such mechanisms. Thanks!

TomLuna avatar Sep 02 '19 10:09 TomLuna

@pyu10055 gentle ping , CC @kangyizhang

rthadur avatar Sep 03 '19 20:09 rthadur

tensorflowjs MirrorPad https://github.com/qzcsgs/tfjs-MirrorPad

qzcsgs avatar Sep 20 '19 10:09 qzcsgs

@vbardiovskyg if this is still an issues, I successfully converted the Magenta model from tf.hub into tf-js:

1. Convert the model checkpoint to tfjs:

tensorflowjs_converter --control_flow_v2=True --input_format=tf_hub --skip_op_check --strip_debug_ops=True --signature_name serving_default https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2 ./models/magenta_tfjs

2. Copy-paste this snippet into your .js or .html (within ): https://github.com/gkcalat/mirrorpad-tfjs/blob/master/mirrorpad.js

UPDATE: a proper MirrorPad implementation seems to be merged in #3951

gkcalat avatar Oct 12 '20 17:10 gkcalat