cuvis_ai.utils.numpy.gen_coco_labels

cuvis_ai.utils.numpy.gen_coco_labels(mask: ndarray, label_names: list, output_dir: str, name: str, img_name: str | None = None, single_object_per_label: bool = False)[source]

generating coco labels from numpy image and mask, occluded objects can not be labeled correctly at the moment :param mask: mask should be a mask containing zeros for background and integers for labels :param label_names: list of labels :param output_dir: path where to save the json file, if the output file already exists, the generated labels will be appended :param name: name of the json file :param img: image for which these labels apply :param single_object_per_label: clarify if every object has its own label or if multiple objects share the same label. default = False

Returns: