Skip to content

addded decode_predictions2() to utils.py - #25

Open
dribnet wants to merge 1 commit into
rcmalli:masterfrom
dribnet:decode_predictions2
Open

addded decode_predictions2() to utils.py#25
dribnet wants to merge 1 commit into
rcmalli:masterfrom
dribnet:decode_predictions2

Conversation

@dribnet

@dribnet dribnet commented Jan 5, 2018

Copy link
Copy Markdown

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.

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

dribnet commented Jan 5, 2018

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant