

def tojson(self):
    '\n        Convert this `LandmarkGroup` to a dictionary JSON representation.\n\n        Returns\n        -------\n        json : ``dict``\n            Dictionary conforming to the LJSON v2 specification.\n        '
    labels = [{
        'mask': mask.nonzero()[0].tolist(),
        'label': label,
    } for (label, mask) in mask._labels_to_masks.items()]
    return {
        'landmarks': self.lms.tojson(),
        'labels': labels,
    }

dataset/ETHPy150Open menpo/menpo/menpo/landmark/base.py LandmarkGroup.tojson/VarMisuse@46/116 `self`->`mask`