keras-arcface icon indicating copy to clipboard operation
keras-arcface copied to clipboard

how to predict by trained model?

Open chenyanyin opened this issue 3 years ago • 2 comments

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]

chenyanyin avatar Sep 29 '20 07:09 chenyanyin

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

rlrahulkanojia avatar Nov 16 '20 09:11 rlrahulkanojia

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

this is class feature, not class probability

farhantandia avatar Apr 27 '21 06:04 farhantandia