Skip to content

Commit

Permalink
Merge pull request #11 from remicres/8-fix_image_summary_dynamic
Browse files Browse the repository at this point in the history
FIX: preview function for image summary
  • Loading branch information
remicres authored Mar 11, 2021
2 parents 4addaf8 + f3888b1 commit afc7eaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,7 @@ def nice_preview(x):
means = tf.math.reduce_mean(x, axis=axis, keepdims=True)
mins = means - 2 * stds
maxs = means + 2 * stds
return tf.cast(255 * tf.divide(x - mins, maxs - mins), tf.uint8)
x = tf.divide(x - mins, maxs - mins)
x = tf.clip_by_value(x, clip_value_min=0, clip_value_max=1)
return tf.cast(255 * x, tf.uint8)

0 comments on commit afc7eaf

Please sign in to comment.