Python code to fit a gaussian mixture model to an image using various methods