Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Improve data transform for gluon data loader #11183

Merged
merged 9 commits into from
Jun 14, 2018

Conversation

hetong007
Copy link
Contributor

Description

  1. Modify default value of interpolation to 1, i.e. bilinear interpolation. The current value is 2 for cubic interpolation, which does not match the document.
  2. Add keep_aspect_ratio to transforms.Resize, so that its default behavior is to resize the short edge to the single input size value.

Checklist

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:

@hetong007 hetong007 requested a review from szha as a code owner June 7, 2018 08:32
wsize = int(w * hsize / h)
else:
wsize, hsize = self._size
_args = tuple((wsize, hsize)) + (self._interpolation,)
Copy link
Contributor

Choose a reason for hiding this comment

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

image.imresize(x, wsize, hsize, self._interpolation)

@@ -250,6 +250,9 @@ class Resize(Block):
----------
size : int or tuple of (W, H)
Size of output image.
keep_aspect_ratio : bool
Copy link
Contributor

Choose a reason for hiding this comment

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

keep_aspect_ratio feels too long

Copy link
Contributor

Choose a reason for hiding this comment

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

keep_ratio?

@piiswrong piiswrong merged commit b819fd9 into apache:master Jun 14, 2018
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* improve transforms.Resize

* fix

* Trigger CI

* Trigger CI

* improve

* Trigger CI

* Trigger CI

* fix unittest

* keep_ratio is false by default, to keep consistency
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
* improve transforms.Resize

* fix

* Trigger CI

* Trigger CI

* improve

* Trigger CI

* Trigger CI

* fix unittest

* keep_ratio is false by default, to keep consistency
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants