{"id":45257,"library":"labelme","title":"labelme","description":"Labelme is a graphical image annotation tool written in Python. Current version 6.3.1 (requires Python >=3.10). It provides a polygon-based annotation interface for segmentation, classification, and other labeling tasks. Development is active but with occasional long gaps between releases.","status":"active","version":"6.3.1","language":"python","source_language":"en","source_url":"https://github.com/wkentaro/labelme","tags":["annotation","labeling","segmentation","gui"],"install":[{"cmd":"pip install labelme","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Aliasing is unnecessary; labelme is the canonical import.","wrong":"import labelme as lm","symbol":"labelme","correct":"import labelme"}],"quickstart":{"code":"import labelme\nfrom labelme import utils\nimport os.path as osp\n\n# Launch the annotation GUI\nlabelme.main()\n\n# Example: convert JSON annotations to label images\njson_file = 'example.json'\nif osp.isfile(json_file):\n    data = labelme.LabelFile.load_json(json_file)\n    label_img, label_names = utils.labelme_shapes_to_label(\n        img_shape=(data['imageHeight'], data['imageWidth']),\n        shapes=data['shapes']\n    )\n    print(f'Label image shape: {label_img.shape}')\n    print(f'Label names: {label_names}')","lang":"python","description":"Basic usage: launch the GUI and convert annotations to label images."},"warnings":[{"fix":"Use data['imageHeight'] instead of data.imageHeight.","message":"labelme.LabelFile.load_json returns a dict-like object, not a class instance. Access data fields as dict keys (e.g., data['imageHeight']), not attributes.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Use labelme.LabelFile.load_image_file instead.","message":"The function labelme.utils.image_data_from_file is deprecated and may be removed in future versions.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Upgrade Python to 3.10+ or pin labelme to 5.x.","message":"In version 6.0.0, the minimum Python version was raised to 3.10. Installations on older Python will fail.","severity":"breaking","affected_versions":">=6.0.0, <7.0.0"},{"fix":"Keep image and JSON in the same directory or use absolute paths when opening.","message":"Labelme saves annotations in JSON format, but the image file paths are stored as relative paths from the JSON location. Moving files after annotation breaks the links.","severity":"gotcha","affected_versions":"All"},{"fix":"Run labelme on a machine with a display or use an alternative like labelme2coco for headless conversion.","message":"When using labelme from a headless environment (no display), the GUI will crash. The library does not provide a CLI batch mode without display.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'3.10':17 '6.3.1':14 'activ':35 'annot':7,24,43 'base':23 'classif':28 'current':12 'develop':33 'gap':40 'graphic':5 'gui':46 'imag':6 'interfac':25 'label':31,44 'labelm':1,2 'long':39 'occasion':38 'polygon':22 'polygon-bas':21 'provid':19 'python':11,16 'releas':42 'requir':15 'segment':27,45 'task':32 'tool':8 'version':13 'written':9","created_at":"2026-06-07T12:54:08.056075+00:00","updated_at":"2026-06-07T12:54:08.056075+00:00","problems":[{"fix":"pip install labelme","cause":"Labelme is not installed.","error":"ModuleNotFoundError: No module named 'labelme'"},{"fix":"Use 'from labelme import LabelFile' in current versions.","cause":"In older versions (<=4.x), the class was 'LabelFile' but in newer versions it's 'labelme.LabelFile'. Also check case sensitivity.","error":"ImportError: cannot import name 'LabelFile' from 'labelme'"},{"fix":"Add 'import labelme' at the top of your script.","cause":"The module was not imported properly or the import statement is missing.","error":"NameError: name 'labelme' is not defined"},{"fix":"Use data['imageHeight'] instead of data.imageHeight.","cause":"labelme.LabelFile.load_json returns a dict, not an object. Accessing attributes fails.","error":"AttributeError: 'dict' object has no attribute 'imageHeight'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}