hand_ges / preprocessing.py
Manar312's picture
Upload 6 files
c9dcefe verified
Raw
History Blame Contribute Delete
297 Bytes
import cv2
import numpy as np
import tensorflow as tf
IMG_SIZE = 224
def preprocess(image):
image = cv2.resize(image, (IMG_SIZE, IMG_SIZE))
image = tf.keras.applications.mobilenet_v2.preprocess_input(image)
image = np.expand_dims(image, axis=0)
return image