livecellx.annotation.labelme2coco.get_coco_from_labelme_folder

livecellx.annotation.labelme2coco.get_coco_from_labelme_folder(labelme_folder, coco_category_list=None, is_image_in_json_folder=False, image_file_ext='tif', dataset_folder_path=None, is_secondary_dataset=False, get_time_func=<function _get_time_from_filepath>)[source]

Generate coco object from labelme annotations. This function wil load images according to the following rules: :rtype: Coco

  1. If dataset_folder_path is provided, load images from datasets there

  2. If is_image_image_in_json_folder is True, then load image from the same folder as json, with extension replaced by image_file_ext

  3. otherwise try loading from labelme’s json data[‘imagePath’]

Args:

labelme_folder: folder that contains labelme annotations and image files coco_category_list: start from a predefined coco cateory list is_image_in_json_folder: if True, image files are in the same folder as json files dataset_folder_path: the path to the dataset folder

Returns:

Coco: An instance of the Coco class.