scaelles / OSVOS-TensorFlow

One-Shot Video Object Segmentation
http://vision.ee.ethz.ch/~cvlsegmentation/osvos/
GNU General Public License v3.0
438 stars 132 forks source link

class_balanced_cross_entropy_loss_theoretical #4

Closed bhack closed 7 years ago

bhack commented 7 years ago

Do you have any more info why class_balanced_cross_entropy_loss_theoretical didn't work so well?

scaelles commented 7 years ago

It didn't work because there is some numeric instability in the training with the logarithmic function. You can find more information in the TensorFlow inplementation without the class balancing.

bhack commented 7 years ago

Ok this passages remove also sigmoid(). Why you have used:

labels = tf.cast(tf.greater(label, 0.5), tf.float32)

scaelles commented 7 years ago

I used this to make sure that the labels are binary with 0 or 1 values.

bhack commented 7 years ago

Yes I understand this but Davis png annotation are not already 0 or 255?

scaelles commented 7 years ago

Yes, DAVIS has these values, but not all databases do. So I wrote this to enforce that the value of the labels is always correct.

bhack commented 7 years ago

Thanks

j50888 commented 7 years ago

Hi, I have a question. Why the line 800 in the osvos.py use 162.0/255.0 instead of 0.5? res_np = res.astype(np.float32)[0, :, :, 0] > 162.0/255.0

scaelles commented 7 years ago

We use this threshold instead of 0.5 because it's the optimum. However, the results using 0.5 are almost the same.

j50888 commented 7 years ago

Thanks!