Summary
OpenCV 2 command to load an image file.
Description
- Created an array of specified shape and filled it with random values: random_input_data = np.random.randn(1, 3, 224, 224).astype(np.float16)
- Replaced the random values with an image file: random_input_data = np.array(r"<image_dir>\image.png").astype(np.float16)
- Encountered error: ValueError: could not convert string to float: '<image_dir>\image.png'
Resolution
Use cv2.imread("image.png")
Additional information