-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance image.py for gray image. #7786
Conversation
All the interfaces have been tested: >>> import image
>>> im = image.load_image('test_gray.png', False)
>>> print im.shape
(600, 800)
>>> im = image.resize_short(im, 256)
>>> print im.shape
(341, 256)
>>> im = image.center_crop(im, 224, False)
>>> print im.shape
(224, 224)
>>> im = image.random_crop(im, 222, False)
>>> print im.shape
(222, 222)
>>> im = image.left_right_flip(im, False)
>>> print im.shape
(222, 222) |
python/paddle/v2/image.py
Outdated
@@ -278,13 +277,16 @@ def left_right_flip(im): | |||
|
|||
im = left_right_flip(im) | |||
|
|||
:paam im: input image with HWC layout | |||
:paam im: input image with HWC layout or HW layout for gray image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paam->parm笔误,下同。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
python/paddle/v2/image.py
Outdated
:type im: ndarray | ||
:paam is_color: whether color input image or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whether color input image or not -> whether input image is color or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luotao1 Thanks for your review.
python/paddle/v2/image.py
Outdated
@@ -278,13 +277,16 @@ def left_right_flip(im): | |||
|
|||
im = left_right_flip(im) | |||
|
|||
:paam im: input image with HWC layout | |||
:paam im: input image with HWC layout or HW layout for gray image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
python/paddle/v2/image.py
Outdated
:type im: ndarray | ||
:paam is_color: whether color input image or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix #7737