-
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
Image preprocess module. #2084
Image preprocess module. #2084
Conversation
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.
Some tiny English problems.
python/paddle/v2/image.py
Outdated
"left_right_flip", "simple_transform", "load_and_transform" | ||
] | ||
""" | ||
This file contains some common interface for image preprocess. |
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.
interfaces
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
""" | ||
This file contains some common interface for image preprocess. | ||
Many users are confused about the image layout. We introduce | ||
the image layout firstly. |
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.
firstly->as follows.
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
|
||
- CHW Layout | ||
- The abbreviations: C=channel, H=Height, W=Width | ||
- The default image layout is HWC opened by cv2 or PIL. |
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.
opened->formulated ?
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
- CHW Layout | ||
- The abbreviations: C=channel, H=Height, W=Width | ||
- The default image layout is HWC opened by cv2 or PIL. | ||
PaddlePaddle only support the image layout with CHW. |
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.
only support the CHW layout.
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
|
||
- Color format: RGB or BGR | ||
OpenCV use BGR color format. PIL use RGB color format. Both | ||
formats can be used for training. But it must be noted that, |
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.
Note that, the format should be XXX
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
""" | ||
Transpose the input image order. The image layout is HWC format | ||
opened by cv2 or PIL. Transposed the input image to CHW layouts | ||
by order (2,0,1). |
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.
Transpose the input 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
|
||
:param im: the input image with HWC layout. | ||
:type im: ndarray | ||
:param size: the cropping size |
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.
119行加句号。
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
|
||
:param im: the input image with HWC layout. | ||
:type im: ndarray | ||
:param size: the cropping size |
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.
146行加句号。
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
|
||
def simple_transform(im, resize_size, crop_size, is_train, is_color=True): | ||
""" | ||
Simply data argumentation for traing. These operations includes |
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.
training笔误。These operations include
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
is_color=True): | ||
""" | ||
Load image from the input file `filename` and transform image for | ||
data argumentation. Please refer the `simple_transform` interface |
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.
refer to
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.
Thanks! @luotao1
python/paddle/v2/image.py
Outdated
"left_right_flip", "simple_transform", "load_and_transform" | ||
] | ||
""" | ||
This file contains some common interface for image preprocess. |
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
""" | ||
This file contains some common interface for image preprocess. | ||
Many users are confused about the image layout. We introduce | ||
the image layout firstly. |
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
|
||
- CHW Layout | ||
- The abbreviations: C=channel, H=Height, W=Width | ||
- The default image layout is HWC opened by cv2 or PIL. |
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
- CHW Layout | ||
- The abbreviations: C=channel, H=Height, W=Width | ||
- The default image layout is HWC opened by cv2 or PIL. | ||
PaddlePaddle only support the image layout with CHW. |
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
|
||
- Color format: RGB or BGR | ||
OpenCV use BGR color format. PIL use RGB color format. Both | ||
formats can be used for training. But it must be noted that, |
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
""" | ||
Transpose the input image order. The image layout is HWC format | ||
opened by cv2 or PIL. Transposed the input image to CHW layouts | ||
by order (2,0,1). |
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
|
||
:param im: the input image with HWC layout. | ||
:type im: ndarray | ||
:param size: the cropping size |
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
|
||
:param im: the input image with HWC layout. | ||
:type im: ndarray | ||
:param size: the cropping size |
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
|
||
def simple_transform(im, resize_size, crop_size, is_train, is_color=True): | ||
""" | ||
Simply data argumentation for traing. These operations includes |
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
is_color=True): | ||
""" | ||
Load image from the input file `filename` and transform image for | ||
data argumentation. Please refer the `simple_transform` interface |
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.
* fix dide link, test=document * fix dide link, test=document
在v2 API里实现了一些通用的图像预处理函数,并对CHW, RGB顺序写了一些注释,这个顺序对刚接触的用户来说通常会比较疑惑。
related to #2070 #PaddlePaddle/models#28