项目GitHub主页:https://github.com/orobix/retina-unet
参考论文:Retina blood vessel segmentation with a convolution neural network (U-net) Retina blood vessel segmentation with a convolution neural network (U-net)
1.数据封装成HDF5格式
import os
import h5py
import numpy as np
from PIL import Image
def write_hdf5(arr,outfile): # arr:数据 outfile:数据保存文件位置
with h5py.File(outfile,"w") as f:
f.create_dataset("image", data=arr, dtype=arr.dtype)
# 训练数据位置:图像 金标准 掩膜
original_imgs_train = "./DRIVE/training/imag