How to read <HDF5 object reference> in python

I was trying to read the HDF5 file and don’t know how to read the HDF5 object reference

>>> bb= h5py.File('SUNRGBD2Dseg.mat', 'r')>>> bb['SUNRGBD2Dseg']['seglabel']<HDF5 dataset "seglabel": shape (10335, 1), type "|O">>>> bb['SUNRGBD2Dseg']['seglabel'][0]array([<HDF5 object reference>], dtype=object)
>>> bb['SUNRGBD2Dseg']['seglabel']<HDF5 dataset "seglabel": shape (10335, 1), type "|O">>>> ref = bb['SUNRGBD2Dseg']['seglabel'][0][0]>>> res = np.array(bb[ref])>>> res.shape(730, 530)

Data Scientist/MLE/SWE @takemobi