nntoolbox.vision.utils.utils module¶
-
nntoolbox.vision.utils.utils.
compute_output_shape
(inp_dim: int, padding: int, kernel_size: int, dilation: int, stride: int) → int[source]¶
-
nntoolbox.vision.utils.utils.
cv2_read_image
(image_path, to_float: bool = False, flag: int = 1) → numpy.ndarray[source]¶ Read an image using cv2 and convert to RGB
- Parameters
image_path –
to_float – whether to convert image to float dats type:
flag – indicate mode for cv2 read image
- Returns
-
nntoolbox.vision.utils.utils.
is_image
(filename)[source]¶ Check if filename has valid extension
- Parameters
filename –
- Returns
boolean indicating whether filename is a valid image filename