This repository contains the code implementation used in the paper: "Point Label Aware Superpixels for Multi-species Segmentation of Underwater Imagery"
), sth like distortion_loss_from_sparse_pixels (don't be afraid of long but self-explanatory variables). Also, is that really what it does? It seems like it's actually used to enable/disable the conflict loss? Does it work if you set flag to false?
Rename hard() to soft_to_hard() and rename the first argument to soft.
This will require a split of the code into re-useable modules, and a script that calls those modules. The code is already well organised so this shouldn't be much of a deal.