Skip to content

Commit

Permalink
change accuracy compute method
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeShewill-CV committed May 21, 2019
1 parent 5055bbf commit 91e125e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/evaluate_model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def calculate_model_precision(input_tensor, label_tensor):
logits = tf.nn.softmax(logits=input_tensor)
final_output = tf.expand_dims(tf.argmax(logits, axis=-1), axis=-1)

idx = tf.where(tf.equal(label_tensor, 1))
pix_cls_ret = tf.gather_nd(final_output, idx)
idx = tf.where(tf.equal(final_output, 1))
pix_cls_ret = tf.gather_nd(label_tensor, idx)
accuracy = tf.count_nonzero(pix_cls_ret)
accuracy = tf.divide(accuracy, tf.cast(tf.shape(pix_cls_ret)[0], tf.int64))

Expand Down

0 comments on commit 91e125e

Please sign in to comment.