Importing segmentation data from VGG Image Annotator (VIA)

I have a data set containing 10,000 segmented satellite images which were created in VGG Image Annotator, I would like to use these images for image segmentation as in the CamVid example in part 1 lesson 3. However I’m unsure of the best way to pull in the annotations. Could somebody please point me in the right direction?

This is the tool used for the annotation
http://www.robots.ox.ac.uk/~vgg/software/via/via.html

Ok so I managed to sort this myself, if anyone in the future has this same problem my solution is below,
It’s not very nice code but it works, and is pretty quick. It only takes a couple seconds to process 10,000 annotations