Issues with segmentation

I am trying to use the segmentation demo. When I try it on pretty much any image ( is the one I am testing with for now), it seems to work perfectly in terms of the display of the mask, but the histogram it computes is completely off… It claims there is only one instance of a shirt, but the mask image clearly works perfect and finds the entire shirt the person is wearing. Instead the histogram claims there are 15 instances found of bra/bikini? Does anyone know what this issue is? Does this image work for anyone else? Could it be too high res? Or what other issues could make the histogram break this badly while the image mask works fine?

Update: So i guess the histogram was generating the bins wrong. When I directly set the bins to range(self.num_classes) it works fine, otherwise the histogram generates weird non int values for bin edges for some reason.

Thanks @duner - are you referring to the code in

Here is how I set the bins now:

class_histogram, _ = np.histogram(self.class_mask_np, self.num_classes)

Did you change this to the following?

class_histogram, _ = np.histogram(self.class_mask_np, range(self.num_classes))