Bone / utils.py
kris524's picture
Create utils.py
5866141 verified
raw
history blame contribute delete
266 Bytes
import cv2
import numpy as np
def preprocess_image(image):
image = np.array(image)
image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
image = cv2.resize(image, (224, 224))
image = image / 255.0
image = image.reshape(1, 224, 224, 1)
return image