ipfml.utils¶
Utils functions of ipfml package (array normalization)
Functions
normalize_2D_arr (arr) |
Return array normalize from its min and max values |
normalize_arr (arr) |
Normalize data of 1D array shape |
normalize_arr_with_range (arr, min, max) |
Normalize data of 1D array shape |
-
ipfml.utils.
normalize_2D_arr
(arr)[source]¶ Return array normalize from its min and max values
Parameters: arr – 2D Numpy array Returns: Normalized 2D Numpy array Example:
>>> from PIL import Image >>> from ipfml import utils, processing >>> img = Image.open('./images/test_img.png') >>> img_mscn = processing.rgb_to_mscn(img) >>> img_normalized = utils.normalize_2D_arr(img_mscn) >>> img_normalized.shape (200, 200)
-
ipfml.utils.
normalize_arr
(arr)[source]¶ Normalize data of 1D array shape
Parameters: arr – array data of 1D shape Returns: Normalized 1D array Example:
>>> from ipfml import utils >>> import numpy as np >>> arr = np.arange(11) >>> arr_normalized = utils.normalize_arr(arr) >>> arr_normalized[1] 0.1
-
ipfml.utils.
normalize_arr_with_range
(arr, min, max)[source]¶ Normalize data of 1D array shape
Parameters: arr – array data of 1D shape Returns: Normalized 1D Numpy array Example:
>>> from ipfml import processing >>> import numpy as np >>> arr = np.arange(11) >>> arr_normalized = processing.normalize_arr_with_range(arr, 0, 20) >>> arr_normalized[1] 0.05