siamese/evaluate.py
raphael fbc6ee8187 remodels siamese network with vgg16 and 100x100 input
- worse performance than with initial design
- vgg16 pretrained weights are used for the base
  network, which is then piped into a custom head
  model, which
    - flattens the layer (previously done in the base model)
    + Dense Layer
    + Normalization
    + Activation
- training split with 360 fruits used, same as previous mode
- maximum prediction level around 0.95 after ca 60 epochs
2021-07-28 19:02:48 +02:00

14 lines
499 B
Python

import tensorflow.keras as keras
from PIL import Image
import numpy as np
import pdb
model = keras.models.load_model('./siamese_checkpoint')
image1 = np.asarray(Image.open('../towards/data/fruits-360/Training/Avocado/r_254_100.jpg').convert('RGB').resize((100,
100))) / 255
image2 = np.asarray(Image.open('../towards/data/fruits-360/Training/Avocado/r_250_100.jpg').convert('RGB').resize((100,
100))) / 255
output = model.predict([np.array([image2]), np.array([image1])])
pdb.set_trace()