Spaces:
Running
Running
import cv2 | |
import numpy as np | |
def image_preprocessing(img_path): | |
img =cv2.imread(img_path) | |
img = cv2.resize(img,(128,128)) | |
img= cv2.cvtColor(img,cv2.COLOR_BayerGR2RGB) | |
img = img/255.0 | |
img = np.expand_dims(img,axis=0) | |
return img | |