LabelMe#
- class LabelMe(filename: str)[source]#
Read annotations from a LabelMe JSON file.
- Parameters:
filename (str) – path to LabelMe JSON file
The reader returns three values:
an
Imagea list of
Polygon2instances for all shapesfile-level
flagsas a dictionary
For each returned polygon, additional attributes are attached:
group_idfrom the shape entryflagsfrom the shape entry as a dictionary
Rectangle shapes are converted to 4-corner polygons.
Example:
from machinevisiontoolbox import LabelMe image, polygons, flags = LabelMe("scene.json").read() len(polygons)
- Seealso:
pixels_maskImage.PolygonsImage,Polygon2
Methods
Read LabelMe JSON and return image, polygons and file flags.
Attributes