分割 json_to_dataset DONG2020

指定Annotations路径,JPEGImages路径,类别名对应自定义标签,输出4个文件夹(原图,标签图,色彩掩码图,掩码可视化图)->下载专利下载code

 jupyter-notbook.exe

data_to_dataset.ipynb

# labelme 制作的数据 Annotations 和 JEPGImages,重点Annotations,因为里面自带图片数据了
json_file = r".\dataset"
image_file = r".\dataset\JPEGImages"
out = r".\dataset"
label_name_to_value = {'_background_': 0, "xxname":2, "xxname":1} # 指定类名对应的标签,bk总是为第0


import os
import numpy as np
from matplotlib import pyplot as plt
import PIL.Image
import json
import glob
import base64
from image import *
from shape import *
from draw import *
from draw import label_colormap
from skimage import img_as_ubyte
from PIL import Image
import tensorflow as tf

if out is None:
    out_dir = os.path.basename(json_file).replace('.', '_')
    out_dir = os.path.join(os.path.dirname(json_file), out_

你可能感兴趣的:(#,深度学习,图像分割)