kmaninis / OSVOS-PyTorch

PyTorch implementation of One-Shot Video Object Segmentation (OSVOS)
http://vision.ee.ethz.ch/~cvlsegmentation/osvos
GNU General Public License v3.0
564 stars 106 forks source link

Fix deprecation warning of scipy.misc.imsave and greyscale seg masks #34

Open timmeinhardt opened 5 years ago

timmeinhardt commented 5 years ago

In the current version of the code the following line causes a deprecation warning:

https://github.com/kmaninis/OSVOS-PyTorch/blob/36562efeed51dd994b44329ea3cff5e0d76e83ac/train_online.py#L189

As suggested by the warning, this PR replaces scipy.misc.imsave with imageio.imsave. In addition, this PR applies a little bit of refactoring to the corresponding code block and resolves a bug that previously the output probabilities of the sigmoid were saved as a greyscale segmentation mask. Now the saved segmentation mask will be the true predicted values, i.e., either 0 or 1.

Fixing this bug leads to a slight improvement in the final metric values. However, these are still lower than the reported values in the ablation study (Table 1) of the paper. Without contour snapping I am able to reproduce a mean J of 0.759 compared to the reported 77.4. Is there still something missing compared to the original TensorFlow version?