Skip to content
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

Merged
merged 3 commits into from
Jan 24, 2018
Merged

Conversation

qingqing01
Copy link
Contributor

@qingqing01 qingqing01 commented Jan 23, 2018

Fix #7737

@qingqing01
Copy link
Contributor Author

qingqing01 commented Jan 23, 2018

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)

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

paam->parm笔误,下同。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

:type im: ndarray
:paam is_color: whether color input image or not
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

@qingqing01 qingqing01 left a 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.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

:type im: ndarray
:paam is_color: whether color input image or not
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@qingqing01 qingqing01 merged commit de797ad into PaddlePaddle:develop Jan 24, 2018
@qingqing01 qingqing01 deleted the fix_image branch March 7, 2018 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants