rcmalli / keras-vggface

VGGFace implementation with Keras Framework
MIT License
928 stars 417 forks source link

addded decode_predictions2() to utils.py #25

Open dribnet opened 6 years ago

dribnet commented 6 years ago

Added a version of decode_predictions specific to vggface2 that returns results in an identical format as the similarily named function in keras.applications.imagenet_utils

Sample response:

[('n001138', 'Bong_Joon-ho', 0.98794019), ('n009064', 'Yang_Yuanqing', 0.0016884505), ('n007811', 'Satoru_Iwata', 0.0016516199), ('n000161', 'Akio_Toyoda', 0.00053648232), ('n007343', 'Richard_Stallman', 0.00044841404)]

Note: depends on vggface2_class_index.json file.

dribnet commented 6 years ago

Here's the vggface2_class_index.json to support this new function. This file could eventually replace the need for rcmalli_vggface_labels_v2.npy (it contains the same label information but also includes class-ids) and is in the same format as the analogous imagenet_class_index.json which is part of the keras distribution. So the code mostly exactly matches that found inkeras.applications.imagenet_utils.decode_predictions and the returned data format also now matches for anyone familiar with that version.

vggface2_class_index.json.zip