Created
April 11, 2020 07:47
-
-
Save quangnhat185/6af318ba7bf64bfa21a75732c60dc5e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocess_image(image_path,resize=False): | |
img = cv2.imread(image_path) | |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | |
img = img / 255 | |
if resize: | |
img = cv2.resize(img, (224,224)) | |
return img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment