Open matheushent opened 4 years ago
I am a little bit lost about what exactly transform_to_normalized_grayscale does. The output of this function just gives me completely black images instead of gray scale images.
@matheushent Totally agree with you. This function does too much things and should be split into multiple ones. At the moment:
Hope it helps a bit, will try to make it cleaner
I have been debugging some functions and I noticed that transform_to_normalized_grayscale defined in tf_explain/utils/image doesn't return a 4D tensor as described in function.
I think the channels axis is being totally disconsidered. So, the keepdims argument inside reduce_sum must be set to True, furthermore
tf.reduce_sum
would be properly changed bytf.math.reduce_sum
.In other words:
grayscale_tensor = tf.math.reduce_sum(tensor, axis=-1, keepdims=True)
instead ofgrayscale_tensor = tf.reduce_sum(tensor, axis=-1)