How to open a Trimap file into indarray

Is there an existing solution to opening a trimap?

This is the segmentation mask I’m using

The dataset on the original website is corrupted. Kaggle matlab was a nightmre too. I used the github here and it worked in 15 seconds.

there goes 5 hours of my life