from tensorflow.keras.applications.mobilenet import MobileNet from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.mobilenet import preprocess_input import numpy as np import cv2 as cv model = MobileNet(weights=‘imagenet‘, include_top=False) img_path = ‘sample1/1.png‘ img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) features = model.predict(x) model.summary() print(features.shape)