You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
As the comments in the function of "ignores_from_label" in layers.py say:
"""Retrieves ignorable pixels from the ground-truth labels. This function returns a binary map in which 1 denotes ignored pixels and 0 means not ignored ones. For those ignored pixels, they are not only the pixels with label value >= num_classes, but also the corresponding neighboring pixels, which are on the the eight cornerls from a (2size+1)x(2size+1) patch.
In my option, it means that it will filter some invalid labels in the input(e.g the 255 in Pascal VOC).
But it seems like that the code is not correct. I made some simple attempts:
N = s * s - 1
tensor = tf.constant(np.random.randint(0, 2, 25, dtype=np.int32), dtype=tf.int32)
tensor = tf.reshape(tensor, (1, 5, 5))
ignore = ignores_from_label(tensor, num_classes=5, size=1)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
print(np.reshape(sess.run(tensor), (5, 5)))
print('------------------')
print(tensor.get_shape().as_list())
out = np.reshape(sess.run(ignore), (5, 5, N))
for n in range(N):
print(n)
print(out[:, :, n].astype(np.int32))
print(n)
print(out[:, :, n].astype(np.int32))
As the comments in the function of "ignores_from_label" in layers.py say:
In my option, it means that it will filter some invalid labels in the input(e.g the 255 in Pascal VOC).
But it seems like that the code is not correct. I made some simple attempts:
the output is:
The result is unexpected. Does it means to ignore the boundary pixels of the image?
The text was updated successfully, but these errors were encountered: