Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add docstring of save_img() in keras/preprocessing/image.py
Signed-off-by: Karel Ha <[email protected]>
  • Loading branch information
mathemage committed Aug 26, 2019
commit a85fe22c51aa880a3e0195fb97d6da45d573221a
15 changes: 15 additions & 0 deletions keras/preprocessing/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ def save_img(path,
data_format=None,
file_format=None,
scale=True, **kwargs):
"""Saves an image stored as a Numpy array to a path or file object.

# Arguments
path: Path or file object.
x: Numpy array.
data_format: Image data format,
either "channels_first" or "channels_last".
If omitted (`None`), then `backend.image_data_format()` is used.
file_format: Optional file format override. If omitted, the
format to use is determined from the filename extension.
If a file object was used instead of a filename, this
parameter should always be used.
scale: Whether to rescale image values to be within `[0, 255]`.
**kwargs: Additional keyword arguments passed to `PIL.Image.save()`.
"""
if data_format is None:
data_format = backend.image_data_format()
return image.save_img(path,
Expand Down