Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to predict by trained model? #23

Open
chenyanyin opened this issue Sep 29, 2020 · 2 comments
Open

how to predict by trained model? #23

chenyanyin opened this issue Sep 29, 2020 · 2 comments

Comments

@chenyanyin
Copy link

cosface_model = load_model('models/attention_vgg8_cosface_3d/model.hdf5', custom_objects={'CosFace': CosFace}) cosface_model = Model(inputs=cosface_model.input[0], outputs=cosface_model.layers[-3].output) cosface_features = cosface_model.predict(X_test, verbose=1) cosface_features /= np.linalg.norm(cosface_features, axis=1, keepdims=True)

as far as i know, cosface_features is 3d-coordinate for each cls, how to get a result when set a input. when 10-cls like mnist, output will be [*, 10]

@rlrahulkanojia
Copy link

np.argmax(embedded_features[0]) - > Class label

@farhantandia
Copy link

np.argmax(embedded_features[0]) - > Class label

this is class feature, not class probability

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

No branches or pull requests

3 participants