You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def load_image_into_numpy_array(path):
"""Load an image from file into a numpy array.
Puts image into numpy array to feed into tensorflow graph.
Note that by convention we put it into a numpy array with shape
(height, width, channels), where channels=3 for RGB.
Args:
path: the file path to the image
Returns:
uint8 numpy array with shape (img_height, img_width, 3)
"""
img_data = tf.io.gfile.GFile(path, 'rb').read()
image = Image.open(BytesIO(img_data))
(im_width, im_height) = image.size
return np.array(image.getdata()).reshape(
(im_height, im_width, 3)).astype(np.uint8)
In this tutorial you just use cv2.imread() which will produce numpy arrays in BGR format.
Not sure if this is has been accounted for and I just missed it but if not then it should be fixed. It should be as easy as adding
The example from the TF2 Model Zoo inference tutorial notebook loads images in RGB format with:
In this tutorial you just use
cv2.imread()
which will produce numpy arrays in BGR format.Not sure if this is has been accounted for and I just missed it but if not then it should be fixed. It should be as easy as adding
here
tf2-object-detection-api-tutorial/detector.py
Line 22 in 91f6e16
The text was updated successfully, but these errors were encountered: