import matplotlib.pyplot as plt
from tensorflow.keras.applications import VGG16 from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.vgg16 import preprocess_input tomo_4.mp4
# Define a function to extract features from frames def extract_features(frames): # Convert frames to batch frames_batch = np.array(frames) # Preprocess for VGG16 frames_batch = preprocess_input(frames_batch) # Extract features features = model.predict(frames_batch) return features import matplotlib