Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Extend Image Function#1719

Closed
srilman wants to merge 2 commits intotensorflow:masterfrom
srilman:extend_images
Closed

Extend Image Function#1719
srilman wants to merge 2 commits intotensorflow:masterfrom
srilman:extend_images

Conversation

@srilman
Copy link
Copy Markdown

@srilman srilman commented Apr 23, 2020

Related to #1318.

Pads an image by extending the borders of the image by some predefined size. I separated it out to a new function because it seemed useful for more situations than just rotation (for example, I used it before calling tf.image.random_crop to get a randomly shifted image). I currently named it tfa.image.extend but it might make more sense to use something like tfa.image.pad____ to fit in line with the other pad functions (tf.image.resize_and_pad, tf.image.pad_to_bounding_box, etc.).

A scalar length to extend the image by on each side.
A tuple of pairs (LH, LW) to extend the image by in each dimension.
A tuple of tuple pairs ((LT, LB), (LL, LR)) to extend the image by for
each individual side
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not implemented yet, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oops! I intended it to add it before but it slipped my mind.

@bhack
Copy link
Copy Markdown
Contributor

bhack commented Jul 23, 2020

/cc @tanzhenyu What do you think about this?

@tanzhenyu
Copy link
Copy Markdown
Contributor

/cc @tanzhenyu What do you think about this?

Can't this be done through tf.image.pad_xxx?

@bhack
Copy link
Copy Markdown
Contributor

bhack commented Jul 24, 2020

It seems to me could be covered by https://www.tensorflow.org/api_docs/python/tf/image/pad_to_bounding_box.

@tanzhenyu
Copy link
Copy Markdown
Contributor

It seems to me could be covered by https://www.tensorflow.org/api_docs/python/tf/image/pad_to_bounding_box.

Yeah

@bhack
Copy link
Copy Markdown
Contributor

bhack commented Jul 24, 2020

I am closing this. Please reopen if you think there there are some others use cases that could be covered by this new API.

@bhack bhack closed this Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants