Views
No views yet
1from huggingface_hub import from_pretrained_keras
2import tensorflow as tf
3
4# Load the model
5model = from_pretrained_keras("samanthajmichael/siamese_model.h5")
6
7# Preprocess your frame pairs (ensure 224x224 resolution)
8# frames should be normalized to [0,1]
9frame1 = preprocess_frame(frame1) # Shape: (224, 224, 3)
10frame2 = preprocess_frame(frame2) # Shape: (224, 224, 3)
11
12# Get similarity prediction
13prediction = model.predict([np.array([frame1]), np.array([frame2])])