towhee.utils.ndarray_utils.from_ndarray

towhee.utils.ndarray_utils.from_ndarray(img: ndarray, mode: str) Image[source]

Convert an image loaded by cv2 as ndarray into towhee.types.Image.

Parameters:
  • img (np.ndarray) – A image loaed by cv2 as ndarray.

  • mode (str) – The mode of the image.

Returns:

(towhee.types.Image)

The image wrapepd as towhee Image.