raphael
4de74afcd1
- evaluation now pauses via pdb and correctly divides the image sizes - coco image requires a 'coco' folder with the COCO 'val2014' and 'annotations' folder downloaded from the cocodataset website - the script splits up the dataset by snipping the bounding- box from the images and saving it into a seperate folder for later parsing by the siamese network
22 lines
539 B
Python
22 lines
539 B
Python
import tensorflow.keras as keras
|
|
from PIL import Image
|
|
import numpy as np
|
|
import pdb
|
|
|
|
def getI(path):
|
|
return np.asarray(Image.open(path).convert('RGB').resize((100, 100))) / 255
|
|
|
|
def predict(image1, image2):
|
|
return model.predict([np.array([image2]), np.array([image1])])
|
|
|
|
model = keras.models.load_model('./siamese_checkpoint')
|
|
image1 = getI('../towards/data/fruits-360/Training/Avocado/r_254_100.jpg')
|
|
image2 = getI('../towards/data/fruits-360/Training/Avocado/r_250_100.jpg')
|
|
|
|
print(predict(image1, image2))
|
|
|
|
pdb.set_trace()
|
|
|
|
|
|
|