following the tutorial Kaggle Notebook for Unet, I am trying to create a function that could store the predicted mask in a folder. While trying below codes, I am getting error 'built-in function imread returned NULL without setting an error'
Please suggest a modification or redirect for potential solutions.
import cv2
import os
image_dir = "/content/sample_data/Output"
def pred_images(sample_image, sample_mask, path):
pred_mask = model.predict(sample_image[tf.newaxis, ...])
print(pred_mask.shape)
pred_mask = pred_mask.reshape(img_size[0],img_size[1],1)
img= cv2.imread(pred_mask, 1)
cv2.imwrite(os.path.join(path, '*.png'), img)
for i in range(len(train_dataset)):
for image, mask in TRAIN.take(i):
sample_image, sample_mask= image, mask
pred_images(sample_image, sample_mask, {image_dir})