instance-segmentation-with-discriminative-loss-tensorflow
instance-segmentation-with-discriminative-loss-tensorflow copied to clipboard
Clustering in discriminative loss
In the original paper https://arxiv.org/pdf/1708.02551.pdf they are used only pixels of concrete class (without background) and then do instance segmentation.
But in discriminative_loss.py you calculate loss for full embedding tensor including background:
unique_labels, unique_id, counts = tf.unique_with_counts(correct_label) counts = tf.cast(counts, tf.float32) num_instances = tf.size(unique_labels)
Here num_instances here = num of lines + 1 (background class)
Am I right?
Yes, you are correct.
Is this advisable? Why not mask the output tensor so that only the foreground pixels are used in the computation of the loss?