How to predict in grayscale image with tensorflow lite?

Hello I’m using tensorflow lite object detectipn api very well on color image.
but i want to predict with grayscale image
but having problem in predicting it with sampel code that tensorflow provid(I presume)
interactive_eager_few_shot_od_training_colab.ipynb - Colaboratory (

to predict, I changed grayscale like (1,720,960,1)
but having error when it goes to detect function.

How can I prdect just like color picture on gray scale image?

Hi @p_jung

Do you mean in python or Java API?

If Python then have you tried converting the image with:
image =“path”).convert(“RGB”)

Check also here:

Or if you have image loaded you can do something like:

image =""path)
tmpImg = np.zeros((image.shape[0],image.shape[1],3))
tmpImg[:,:,0] = image[:,:,0]
tmpImg[:,:,1] = image[:,:,0]
tmpImg[:,:,2] = image[:,:,0]

and use the tmpImg. If you need dimensions like [1,w,h,3] then check: