class_docstr: Test for ndarray utils.
class_docstr_tok: ["Test","for","ndarray","utils","."]
code: def test_from_ndarray(self):
      ndarray_img = cv2.imread(logo_path)
      towhee_img = from_ndarray(ndarray_img, "BGR")
  
      self.assertIsInstance(towhee_img, Image)
  
      self.assertEqual(ndarray_img.shape[0], towhee_img.height)
      self.assertEqual(ndarray_img.shape[1], towhee_img.width)
      self.assertEqual(ndarray_img.shape[2], towhee_img.channel)
      self.assertEqual("BGR", towhee_img.mode)
      self.assertTrue((np.array(ndarray_img) == towhee_img).all())
  
file_path: towhee/tests/unittests/utils/test_ndarray_utils.py
imports: import os
  import unittest
  import numpy
  from pathlib import Path
  from towhee.utils.cv2_utils import cv2
  from towhee.types import Image
  from towhee.utils.ndarray_utils import from_ndarray, from_src, to_ndarray, rgb2bgr
label_desc: Use image node_id 2 for calling the TestPilUtils obj's underlying member method code with example usage: obj.test_from_ndarray() without return types