I have 1000 of images. Now I like to convert those images into grayscale?
import tensorflow as tf
from tensorflow.keras.utils import img_to_array
#df['image_name'] = df['image_name'].apply(str)
df_image = []
for i in tqdm(range(df.shape[0])):
img = image.load_img('/content/drive/MyDrive/Predict DF from Image of Chemical
Structure/2D image/'+df['image_name'][i]+'.png',target_size=(100,100,3))
img = image.img_to_array(img)
img = img/255
df_image.append(img)
X = np.array(df_image)