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

The evaluation #7

Closed
wangping1408 opened this issue Oct 31, 2019 · 1 comment
Closed

The evaluation #7

wangping1408 opened this issue Oct 31, 2019 · 1 comment

Comments

@wangping1408
Copy link

Hello, about the evaluation in your paper, I wonder if you could give me the specific calculation process. I encountered some problems when calculating my result evaluation, thank you.

@TheSouthFrog
Copy link
Owner

TheSouthFrog commented Nov 4, 2019

Do you mean calculating the NME?
You can use this function to test NME normalized by inter-ocular distance:

def calculate_NME(self, logits, labels):
        logits = tf.cast(logits,tf.float32)
        labels = tf.cast(labels,tf.float32)
        subtract_square_distance = tf.square(tf.subtract(logits, labels))
        mean_distance = tf.reduce_mean([tf.sqrt(tf.add(subtract_square_distance[:, column],
                                                       subtract_square_distance[:, column+1])) for column in range(0, 136, 2)], axis=0)

        outer_eye_x = tf.square(tf.subtract(labels[:, 72], labels[:, 90]))
        outer_eye_y = tf.square(tf.subtract(labels[:, 73], labels[:, 91]))
        inter_ocular_distance = tf.sqrt(tf.add(outer_eye_x, outer_eye_y))
        normalized_mean_error = tf.divide(mean_distance, inter_ocular_distance,
                                          name='normalized_mean_error')
        loss_ = tf.reduce_mean(normalized_mean_error)

        return loss_

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

2 participants