An implementation of Manfredi, Grana, and Cucchiara's 2014 ICPR paper "Learning Graph Cut Energy Functions For Image Segmentation" Which Develops on Bertelli,Yu, Vu, and Gokturks "Kernelized Structural SVM Learning For Supervised Object Segmentation"
you can use pip to install it. pip install PyMaxflow