"""
@项目名称:CommonFunctionS.py
@作 者:陆地起飞全靠浪
@创建日期:2022-04-12-11:24
"""
import base64
import copy
import glob
import json
import sys
import time
import cv2 as cv
from paddle.vision import transforms
import os
import numpy as np
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
label_dict = {
'十分大方': 1,
'按时发生': 2,
'暗示法规规定': 3,
'哈根达斯公司第': 4,
'粉色的': 5,
'gas': 6,
'保阿斯蒂芬棚': 7
}
class Mask2PolygonsAndSaveLabelMeJson():
def test_mask_2_labelme_json_by_split_mask(self, mask, img_path, label_dict):
"""按类拆分mask, 通过获取mask的Contours将标签保存为labelMme所需的json标签"""
save_label_dict = {
'version': '5.0.1',
'flags': {