1234567891011121314151617181920212223242526272829303132333435363738394041 |
- # flake8: noqa
- from ._io import lblsave
- from .image import apply_exif_orientation
- from .image import img_arr_to_b64
- from .image import img_arr_to_data
- from .image import img_b64_to_arr
- from .image import img_data_to_arr
- from .image import img_data_to_pil
- from .image import img_data_to_png_data
- from .image import img_pil_to_data
- from .image import img_qt_to_arr
- from .shape import labelme_shapes_to_label
- from .shape import masks_to_bboxes
- from .shape import polygons_to_mask
- from .shape import shape_to_mask
- from .shape import shapes_to_label
- from .qt import newIcon
- from .qt import newButton
- from .qt import newAction
- from .qt import addActions
- from .qt import labelValidator
- from .qt import struct
- from .qt import distance
- from .qt import distancetoline
- from .qt import fmtShortcut
- import os
- def load_barcode_dict():
- """Load the barcode dictionary from the utils folder."""
- dict_path = os.path.join(os.path.dirname(__file__), "barcode_dict.txt")
- try:
- with open(dict_path, "r", encoding="utf-8") as f:
- characters = f.read().splitlines()
- return ["</s>"] + characters # Add special character
- except Exception as e:
- raise FileNotFoundError(f"Error loading barcode_dict.txt: {e}")
|