rcmalli / keras-vggface

VGGFace implementation with Keras Framework
MIT License
936 stars 419 forks source link

Predictions Incorrect #56

Open deluongo opened 5 years ago

deluongo commented 5 years ago

I've seen a number of issues raised about the predictions not being correct. When predicting on a face that's included in the VGG2 dataset I get all incorrect predictions. I've included a screen shot of the predictions. I am using the version 2 processing. The only change I made to the code was to replace keras with tensorflow.keras. However, I tested using base keras as well and I am not seeing correct predictions either.

tf.keras.backend.image_data_format()
model = VGGFace(model='resnet50',  weights='vggface')

def predictFacePic(imagePath):
    img = image.load_img(imagePath, target_size=(224, 224))
    x = image.img_to_array(img)
    x = np.expand_dims(x, axis=0)
    x = utils.preprocess_input(x, version=2)
    preds = loaded_model.predict(x)
    return utils.decode_predictions(preds)
Screen Shot 2019-10-15 at 11 01 45 AM