├── .gitignore ├── README.md ├── codes ├── configuration.txt ├── extract_patches.py ├── help_functions.py ├── pre_processing.py ├── prepare_datasets_DRIVE.py ├── retinaNN_predict.py └── retinaNN_training.py ├── data └── DRIVE │ ├── test │ ├── 1st_manual │ │ ├── 01_manual1.gif │ │ ├── 02_manual1.gif │ │ ├── 03_manual1.gif │ │ ├── 04_manual1.gif │ │ ├── 05_manual1.gif │ │ ├── 06_manual1.gif │ │ ├── 07_manual1.gif │ │ ├── 08_manual1.gif │ │ ├── 09_manual1.gif │ │ ├── 10_manual1.gif │ │ ├── 11_manual1.gif │ │ ├── 12_manual1.gif │ │ ├── 13_manual1.gif │ │ ├── 14_manual1.gif │ │ ├── 15_manual1.gif │ │ ├── 16_manual1.gif │ │ ├── 17_manual1.gif │ │ ├── 18_manual1.gif │ │ ├── 19_manual1.gif │ │ └── 20_manual1.gif │ ├── 2nd_manual │ │ ├── 01_manual2.gif │ │ ├── 02_manual2.gif │ │ ├── 03_manual2.gif │ │ ├── 04_manual2.gif │ │ ├── 05_manual2.gif │ │ ├── 06_manual2.gif │ │ ├── 07_manual2.gif │ │ ├── 08_manual2.gif │ │ ├── 09_manual2.gif │ │ ├── 10_manual2.gif │ │ ├── 11_manual2.gif │ │ ├── 12_manual2.gif │ │ ├── 13_manual2.gif │ │ ├── 14_manual2.gif │ │ ├── 15_manual2.gif │ │ ├── 16_manual2.gif │ │ ├── 17_manual2.gif │ │ ├── 18_manual2.gif │ │ ├── 19_manual2.gif │ │ └── 20_manual2.gif │ ├── images │ │ ├── 01_test.tif │ │ ├── 02_test.tif │ │ ├── 03_test.tif │ │ ├── 04_test.tif │ │ ├── 05_test.tif │ │ ├── 06_test.tif │ │ ├── 07_test.tif │ │ ├── 08_test.tif │ │ ├── 09_test.tif │ │ ├── 10_test.tif │ │ ├── 11_test.tif │ │ ├── 12_test.tif │ │ ├── 13_test.tif │ │ ├── 14_test.tif │ │ ├── 15_test.tif │ │ ├── 16_test.tif │ │ ├── 17_test.tif │ │ ├── 18_test.tif │ │ ├── 19_test.tif │ │ └── 20_test.tif │ └── mask │ │ ├── 01_test_mask.gif │ │ ├── 02_test_mask.gif │ │ ├── 03_test_mask.gif │ │ ├── 04_test_mask.gif │ │ ├── 05_test_mask.gif │ │ ├── 06_test_mask.gif │ │ ├── 07_test_mask.gif │ │ ├── 08_test_mask.gif │ │ ├── 09_test_mask.gif │ │ ├── 10_test_mask.gif │ │ ├── 11_test_mask.gif │ │ ├── 12_test_mask.gif │ │ ├── 13_test_mask.gif │ │ ├── 14_test_mask.gif │ │ ├── 15_test_mask.gif │ │ ├── 16_test_mask.gif │ │ ├── 17_test_mask.gif │ │ ├── 18_test_mask.gif │ │ ├── 19_test_mask.gif │ │ └── 20_test_mask.gif │ └── training │ ├── 1st_manual │ ├── 21_manual1.gif │ ├── 22_manual1.gif │ ├── 23_manual1.gif │ ├── 24_manual1.gif │ ├── 25_manual1.gif │ ├── 26_manual1.gif │ ├── 27_manual1.gif │ ├── 28_manual1.gif │ ├── 29_manual1.gif │ ├── 30_manual1.gif │ ├── 31_manual1.gif │ ├── 32_manual1.gif │ ├── 33_manual1.gif │ ├── 34_manual1.gif │ ├── 35_manual1.gif │ ├── 36_manual1.gif │ ├── 37_manual1.gif │ ├── 38_manual1.gif │ ├── 39_manual1.gif │ └── 40_manual1.gif │ ├── images │ ├── 21_training.tif │ ├── 22_training.tif │ ├── 23_training.tif │ ├── 24_training.tif │ ├── 25_training.tif │ ├── 26_training.tif │ ├── 27_training.tif │ ├── 28_training.tif │ ├── 29_training.tif │ ├── 30_training.tif │ ├── 31_training.tif │ ├── 32_training.tif │ ├── 33_training.tif │ ├── 34_training.tif │ ├── 35_training.tif │ ├── 36_training.tif │ ├── 37_training.tif │ ├── 38_training.tif │ ├── 39_training.tif │ └── 40_training.tif │ └── mask │ ├── 21_training_mask.gif │ ├── 22_training_mask.gif │ ├── 23_training_mask.gif │ ├── 24_training_mask.gif │ ├── 25_training_mask.gif │ ├── 26_training_mask.gif │ ├── 27_training_mask.gif │ ├── 28_training_mask.gif │ ├── 29_training_mask.gif │ ├── 30_training_mask.gif │ ├── 31_training_mask.gif │ ├── 32_training_mask.gif │ ├── 33_training_mask.gif │ ├── 34_training_mask.gif │ ├── 35_training_mask.gif │ ├── 36_training_mask.gif │ ├── 37_training_mask.gif │ ├── 38_training_mask.gif │ ├── 39_training_mask.gif │ └── 40_training_mask.gif └── test01.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # test_segmentation 2 | 基于U-Net的视网膜血管分割 3 | 4 | 在U-Net的基础上添加了注意力机制模块 5 | -------------------------------------------------------------------------------- /codes/configuration.txt: -------------------------------------------------------------------------------- 1 | [data paths] 2 | path_local = ../data/DRIVE_datasets_training_testing/ 3 | train_imgs_original = DRIVE_dataset_imgs_train.hdf5 4 | train_groundTruth = DRIVE_dataset_groundTruth_train.hdf5 5 | train_border_masks = DRIVE_dataset_borderMasks_train.hdf5 6 | test_imgs_original = DRIVE_dataset_imgs_test.hdf5 7 | test_groundTruth = DRIVE_dataset_groundTruth_test.hdf5 8 | test_border_masks = DRIVE_dataset_borderMasks_test.hdf5 9 | 10 | 11 | 12 | [experiment name] 13 | name = test 14 | 15 | 16 | [data attributes] 17 | #Dimensions of the patches extracted from the full images 18 | patch_height = 48 19 | patch_width = 48 20 | 21 | 22 | [training settings] 23 | #number of total patches: 24 | N_subimgs = 190000 25 | #if patches are extracted only inside the field of view: 26 | inside_FOV = False 27 | #Number of training epochs 28 | N_epochs = 5 29 | batch_size = 32 30 | #if running with nohup 31 | nohup = False 32 | 33 | 34 | [testing settings] 35 | #Choose the model to test: best==epoch with min loss, last==last epoch 36 | best_last = best 37 | #number of full images for the test (max 20) 38 | full_images_to_test = 20 39 | #How many original-groundTruth-prediction images are visualized in each image 40 | N_group_visual = 1 41 | #Compute average in the prediction, improve results but require more patches to be predicted 42 | average_mode = True 43 | #Only if average_mode==True. Stride for patch extraction, lower value require more patches to be predicted 44 | stride_height = 5 45 | stride_width = 5 46 | #if running with nohup 47 | nohup = False 48 | -------------------------------------------------------------------------------- /codes/extract_patches.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import random 3 | import configparser 4 | 5 | from help_functions import load_hdf5 6 | from help_functions import visualize 7 | from help_functions import group_images 8 | 9 | from pre_processing import my_PreProc 10 | 11 | 12 | #To select the same images 13 | # random.seed(10) 14 | 15 | #Load the original data and return the extracted patches for training/testing 16 | def get_data_training(DRIVE_train_imgs_original, 17 | DRIVE_train_groudTruth, 18 | patch_height, 19 | patch_width, 20 | N_subimgs, 21 | inside_FOV): 22 | train_imgs_original = load_hdf5(DRIVE_train_imgs_original) 23 | train_masks = load_hdf5(DRIVE_train_groudTruth) #masks always the same 24 | # visualize(group_images(train_imgs_original[0:20,:,:,:],5),'imgs_train')#.show() #check original imgs train 25 | 26 | 27 | train_imgs = my_PreProc(train_imgs_original) # 进行数据预处理 28 | train_masks = train_masks/255. 29 | 30 | train_imgs = train_imgs[:,:,9:574,:] #cut bottom and top so now it is 565*565 31 | train_masks = train_masks[:,:,9:574,:] #cut bottom and top so now it is 565*565 32 | data_consistency_check(train_imgs,train_masks) 33 | 34 | #check masks are within 0-1 35 | assert(np.min(train_masks)==0 and np.max(train_masks)==1) 36 | 37 | print("\ntrain images/masks shape:") 38 | print(train_imgs.shape) 39 | print("train images range (min-max): " +str(np.min(train_imgs)) +' - '+str(np.max(train_imgs))) 40 | print("train masks are within 0-1\n") 41 | 42 | #extract the TRAINING patches from the full images 43 | patches_imgs_train, patches_masks_train = extract_random(train_imgs,train_masks,patch_height,patch_width,N_subimgs,inside_FOV) 44 | data_consistency_check(patches_imgs_train, patches_masks_train) 45 | 46 | print("\ntrain PATCHES images/masks shape:") 47 | print(patches_imgs_train.shape) 48 | print("train PATCHES images range (min-max): " +str(np.min(patches_imgs_train)) +' - '+str(np.max(patches_imgs_train))) 49 | 50 | return patches_imgs_train, patches_masks_train#, patches_imgs_test, patches_masks_test 51 | 52 | 53 | #Load the original data and return the extracted patches for training/testing 54 | def get_data_testing(DRIVE_test_imgs_original, DRIVE_test_groudTruth, Imgs_to_test, patch_height, patch_width): 55 | ### test 56 | test_imgs_original = load_hdf5(DRIVE_test_imgs_original) 57 | test_masks = load_hdf5(DRIVE_test_groudTruth) 58 | 59 | test_imgs = my_PreProc(test_imgs_original) 60 | test_masks = test_masks/255. 61 | 62 | #extend both images and masks so they can be divided exactly by the patches dimensions 63 | test_imgs = test_imgs[0:Imgs_to_test,:,:,:] 64 | test_masks = test_masks[0:Imgs_to_test,:,:,:] 65 | test_imgs = paint_border(test_imgs,patch_height,patch_width) 66 | test_masks = paint_border(test_masks,patch_height,patch_width) 67 | 68 | data_consistency_check(test_imgs, test_masks) 69 | 70 | #check masks are within 0-1 71 | assert(np.max(test_masks)==1 and np.min(test_masks)==0) 72 | 73 | print("\ntest images/masks shape:") 74 | print(test_imgs.shape) 75 | print("test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs))) 76 | print("test masks are within 0-1\n") 77 | 78 | #extract the TEST patches from the full images 79 | patches_imgs_test = extract_ordered(test_imgs,patch_height,patch_width) 80 | patches_masks_test = extract_ordered(test_masks,patch_height,patch_width) 81 | data_consistency_check(patches_imgs_test, patches_masks_test) 82 | 83 | print("\ntest PATCHES images/masks shape:") 84 | print(patches_imgs_test.shape) 85 | print("test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test))) 86 | 87 | return patches_imgs_test, patches_masks_test 88 | 89 | 90 | 91 | 92 | # Load the original data and return the extracted patches for testing 93 | # return the ground truth in its original shape 94 | def get_data_testing_overlap(DRIVE_test_imgs_original, DRIVE_test_groudTruth, Imgs_to_test, patch_height, patch_width, stride_height, stride_width): 95 | ### test 96 | test_imgs_original = load_hdf5(DRIVE_test_imgs_original) 97 | test_masks = load_hdf5(DRIVE_test_groudTruth) 98 | 99 | test_imgs = my_PreProc(test_imgs_original) 100 | test_masks = test_masks/255. 101 | #extend both images and masks so they can be divided exactly by the patches dimensions 102 | test_imgs = test_imgs[0:Imgs_to_test,:,:,:] 103 | test_masks = test_masks[0:Imgs_to_test,:,:,:] 104 | test_imgs = paint_border_overlap(test_imgs, patch_height, patch_width, stride_height, stride_width) 105 | 106 | #check masks are within 0-1 107 | assert(np.max(test_masks)==1 and np.min(test_masks)==0) 108 | 109 | print("\ntest images shape:") 110 | print(test_imgs.shape) 111 | print("\ntest mask shape:") 112 | print(test_masks.shape) 113 | print("test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs))) 114 | print("test masks are within 0-1\n") 115 | 116 | #extract the TEST patches from the full images 117 | patches_imgs_test = extract_ordered_overlap(test_imgs,patch_height,patch_width,stride_height,stride_width) 118 | 119 | print("\ntest PATCHES images shape:") 120 | print(patches_imgs_test.shape) 121 | print("test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test))) 122 | 123 | return patches_imgs_test, test_imgs.shape[2], test_imgs.shape[3], test_masks 124 | 125 | 126 | #data consinstency check 127 | def data_consistency_check(imgs,masks): 128 | assert(len(imgs.shape)==len(masks.shape)) 129 | assert(imgs.shape[0]==masks.shape[0]) 130 | assert(imgs.shape[2]==masks.shape[2]) 131 | assert(imgs.shape[3]==masks.shape[3]) 132 | assert(masks.shape[1]==1) 133 | assert(imgs.shape[1]==1 or imgs.shape[1]==3) 134 | 135 | 136 | #extract patches randomly in the full training images 137 | # -- Inside OR in full image 138 | def extract_random(full_imgs,full_masks, patch_h,patch_w, N_patches, inside=True): 139 | if (N_patches%full_imgs.shape[0] != 0): 140 | print("N_patches: plase enter a multiple of 20") 141 | exit() 142 | assert (len(full_imgs.shape)==4 and len(full_masks.shape)==4) #4D arrays 143 | assert (full_imgs.shape[1]==1 or full_imgs.shape[1]==3) #check the channel is 1 or 3 144 | assert (full_masks.shape[1]==1) #masks only black and white 145 | assert (full_imgs.shape[2] == full_masks.shape[2] and full_imgs.shape[3] == full_masks.shape[3]) 146 | patches = np.empty((N_patches,full_imgs.shape[1],patch_h,patch_w)) 147 | patches_masks = np.empty((N_patches,full_masks.shape[1],patch_h,patch_w)) 148 | img_h = full_imgs.shape[2] #height of the full image 149 | img_w = full_imgs.shape[3] #width of the full image 150 | # (0,0) in the center of the image 151 | patch_per_img = int(N_patches/full_imgs.shape[0]) #N_patches equally divided in the full images 152 | print("patches per full image: " +str(patch_per_img)) 153 | iter_tot = 0 #iter over the total numbe rof patches (N_patches) 154 | for i in range(full_imgs.shape[0]): #loop over the full images 155 | k=0 156 | while k 整数之间的划分 247 | N_patches_tot = N_patches_img*full_imgs.shape[0] 248 | print("Number of patches on h : " +str(((img_h-patch_h)//stride_h+1))) 249 | print("Number of patches on w : " +str(((img_w-patch_w)//stride_w+1))) 250 | print("number of patches per image: " +str(N_patches_img) +", totally for this dataset: " +str(N_patches_tot)) 251 | patches = np.empty((N_patches_tot,full_imgs.shape[1],patch_h,patch_w)) 252 | iter_tot = 0 #iter over the total number of patches (N_patches) 253 | for i in range(full_imgs.shape[0]): #loop over the full images 254 | for h in range((img_h-patch_h)//stride_h+1): 255 | for w in range((img_w-patch_w)//stride_w+1): 256 | patch = full_imgs[i,:,h*stride_h:(h*stride_h)+patch_h,w*stride_w:(w*stride_w)+patch_w] 257 | patches[iter_tot]=patch 258 | iter_tot +=1 #total 259 | assert (iter_tot==N_patches_tot) 260 | return patches #array with all the full_imgs divided in patches 261 | 262 | 263 | def recompone_overlap(preds, img_h, img_w, stride_h, stride_w): 264 | assert (len(preds.shape)==4) #4D arrays 265 | assert (preds.shape[1]==1 or preds.shape[1]==3) #check the channel is 1 or 3 266 | patch_h = preds.shape[2] 267 | patch_w = preds.shape[3] 268 | N_patches_h = (img_h-patch_h)//stride_h+1 269 | N_patches_w = (img_w-patch_w)//stride_w+1 270 | N_patches_img = N_patches_h * N_patches_w 271 | print("N_patches_h: " +str(N_patches_h)) 272 | print("N_patches_w: " +str(N_patches_w)) 273 | print("N_patches_img: " +str(N_patches_img)) 274 | assert (preds.shape[0]%N_patches_img==0) 275 | N_full_imgs = preds.shape[0]//N_patches_img 276 | print("According to the dimension inserted, there are " +str(N_full_imgs) +" full images (of " +str(img_h)+"x" +str(img_w) +" each)") 277 | full_prob = np.zeros((N_full_imgs,preds.shape[1],img_h,img_w)) #itialize to zero mega array with sum of Probabilities 278 | full_sum = np.zeros((N_full_imgs,preds.shape[1],img_h,img_w)) 279 | 280 | k = 0 #iterator over all the patches 281 | for i in range(N_full_imgs): 282 | for h in range((img_h-patch_h)//stride_h+1): 283 | for w in range((img_w-patch_w)//stride_w+1): 284 | full_prob[i,:,h*stride_h:(h*stride_h)+patch_h,w*stride_w:(w*stride_w)+patch_w]+=preds[k] 285 | full_sum[i,:,h*stride_h:(h*stride_h)+patch_h,w*stride_w:(w*stride_w)+patch_w]+=1 286 | k+=1 287 | assert(k==preds.shape[0]) 288 | assert(np.min(full_sum)>=1.0) #at least one 289 | final_avg = full_prob/full_sum 290 | print(final_avg.shape) 291 | assert(np.max(final_avg)<=1.0) #max value for a pixel is 1.0 292 | assert(np.min(final_avg)>=0.0) #min value for a pixel is 0.0 293 | return final_avg 294 | 295 | 296 | #Recompone the full images with the patches 297 | def recompone(data,N_h,N_w): 298 | assert (data.shape[1]==1 or data.shape[1]==3) #check the channel is 1 or 3 299 | assert(len(data.shape)==4) 300 | N_pacth_per_img = N_w*N_h 301 | assert(data.shape[0]%N_pacth_per_img == 0) 302 | N_full_imgs = data.shape[0]/N_pacth_per_img 303 | patch_h = data.shape[2] 304 | patch_w = data.shape[3] 305 | N_pacth_per_img = N_w*N_h 306 | #define and start full recompone 307 | full_recomp = np.empty((N_full_imgs,data.shape[1],N_h*patch_h,N_w*patch_w)) 308 | k = 0 #iter full img 309 | s = 0 #iter single patch 310 | while (s= DRIVE_masks.shape[3] or y >= DRIVE_masks.shape[2]): #my image bigger than the original 384 | return False 385 | 386 | if (DRIVE_masks[i,0,y,x]>0): #0==black pixels 387 | # print DRIVE_masks[i,0,y,x] #verify it is working right 388 | return True 389 | else: 390 | return False 391 | -------------------------------------------------------------------------------- /codes/help_functions.py: -------------------------------------------------------------------------------- 1 | import h5py 2 | import numpy as np 3 | from PIL import Image 4 | from matplotlib import pyplot as plt 5 | 6 | def load_hdf5(infile): 7 | with h5py.File(infile,"r") as f: #"with" close the file after its nested commands 8 | return f["image"][()] 9 | 10 | def write_hdf5(arr,outfile): 11 | with h5py.File(outfile,"w") as f: 12 | f.create_dataset("image", data=arr, dtype=arr.dtype) 13 | 14 | #convert RGB image in black and white 15 | def rgb2gray(rgb): 16 | assert (len(rgb.shape)==4) #4D arrays 17 | assert (rgb.shape[1]==3) 18 | bn_imgs = rgb[:,0,:,:]*0.299 + rgb[:,1,:,:]*0.587 + rgb[:,2,:,:]*0.114 19 | bn_imgs = np.reshape(bn_imgs,(rgb.shape[0],1,rgb.shape[2],rgb.shape[3])) 20 | return bn_imgs 21 | 22 | #group a set of images row per columns 23 | def group_images(data,per_row): 24 | assert data.shape[0]%per_row==0 25 | assert (data.shape[1]==1 or data.shape[1]==3) 26 | data = np.transpose(data,(0,2,3,1)) #corect format for imshow 27 | all_stripe = [] 28 | for i in range(int(data.shape[0]/per_row)): 29 | stripe = data[i*per_row] 30 | for k in range(i*per_row+1, i*per_row+per_row): 31 | stripe = np.concatenate((stripe,data[k]),axis=1) 32 | all_stripe.append(stripe) 33 | totimg = all_stripe[0] 34 | for i in range(1,len(all_stripe)): 35 | totimg = np.concatenate((totimg,all_stripe[i]),axis=0) 36 | return totimg 37 | 38 | 39 | #visualize image (as PIL image, NOT as matplotlib!) 40 | def visualize(data,filename): 41 | assert (len(data.shape)==3) #height*width*channels 42 | img = None 43 | if data.shape[2]==1: #in case it is black and white 44 | data = np.reshape(data,(data.shape[0],data.shape[1])) 45 | if np.max(data)>1: 46 | img = Image.fromarray(data.astype(np.uint8)) #the image is already 0-255 47 | else: 48 | img = Image.fromarray((data*255).astype(np.uint8)) #the image is between 0-1 49 | img.save(filename + '.png') 50 | return img 51 | 52 | 53 | #prepare the mask in the right shape for the Unet 54 | def masks_Unet(masks): 55 | assert (len(masks.shape)==4) #4D arrays 56 | assert (masks.shape[1]==1 ) #check the channel is 1 57 | im_h = masks.shape[2] 58 | im_w = masks.shape[3] 59 | masks = np.reshape(masks,(masks.shape[0],im_h*im_w)) 60 | new_masks = np.empty((masks.shape[0],im_h*im_w,2)) 61 | for i in range(masks.shape[0]): 62 | for j in range(im_h*im_w): 63 | if masks[i,j] == 0: 64 | new_masks[i,j,0]=1 65 | new_masks[i,j,1]=0 66 | else: 67 | new_masks[i,j,0]=0 68 | new_masks[i,j,1]=1 69 | return new_masks 70 | 71 | 72 | def pred_to_imgs(pred, patch_height, patch_width, mode="original"): 73 | assert (len(pred.shape)==3) #3D array: (Npatches,height*width,2) 74 | assert (pred.shape[2]==2 ) #check the classes are 2 75 | pred_images = np.empty((pred.shape[0],pred.shape[1])) #(Npatches,height*width) 76 | if mode=="original": 77 | for i in range(pred.shape[0]): 78 | for pix in range(pred.shape[1]): 79 | pred_images[i,pix]=pred[i,pix,1] 80 | elif mode=="threshold": 81 | for i in range(pred.shape[0]): 82 | for pix in range(pred.shape[1]): 83 | if pred[i,pix,1]>=0.5: 84 | pred_images[i,pix]=1 85 | else: 86 | pred_images[i,pix]=0 87 | else: 88 | print("mode " +str(mode) +" not recognized, it can be 'original' or 'threshold'") 89 | exit() 90 | pred_images = np.reshape(pred_images,(pred_images.shape[0],1, patch_height, patch_width)) 91 | return pred_images 92 | -------------------------------------------------------------------------------- /codes/pre_processing.py: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # 3 | # 预 处 理 原 始 眼 底 视 网 膜 图 像 4 | # 5 | ################################################## 6 | 7 | 8 | import numpy as np 9 | from PIL import Image 10 | import cv2 11 | 12 | from help_functions import * 13 | 14 | 15 | #My pre processing (use for both training and testing!) 16 | def my_PreProc(data): 17 | assert(len(data.shape)==4) 18 | assert (data.shape[1]==3) #Use the original images 19 | #转换为灰度图 20 | train_imgs = rgb2gray(data) 21 | #my preprocessing: 22 | train_imgs = dataset_normalized(train_imgs) #规范化数据集 23 | train_imgs = clahe_equalized(train_imgs) #对比度受限的自适应直方图均衡化 24 | train_imgs = adjust_gamma(train_imgs, 1.2) #伽马变化 25 | train_imgs = train_imgs/255. #reduce to 0-1 range 26 | return train_imgs 27 | 28 | 29 | #============================================================ 30 | #========= PRE PROCESSING FUNCTIONS ========================# 31 | #============================================================ 32 | 33 | #====== 直方图均衡化 ======# 34 | def histo_equalized(imgs): 35 | assert (len(imgs.shape)==4) #4D arrays 36 | assert (imgs.shape[1]==1) #check the channel is 1 37 | imgs_equalized = np.empty(imgs.shape) 38 | for i in range(imgs.shape[0]): 39 | imgs_equalized[i,0] = cv2.equalizeHist(np.array(imgs[i,0], dtype = np.uint8)) 40 | return imgs_equalized 41 | 42 | 43 | #========== 对比度受限的自适应直方图均衡化 ====== 44 | #adaptive histogram equalization is used. In this, image is divided into small blocks called "tiles" (tileSize is 8x8 by default in OpenCV). Then each of these blocks are histogram equalized as usual. So in a small area, histogram would confine to a small region (unless there is noise). If noise is there, it will be amplified. To avoid this, contrast limiting is applied. If any histogram bin is above the specified contrast limit (by default 40 in OpenCV), those pixels are clipped and distributed uniformly to other bins before applying histogram equalization. After equalization, to remove artifacts in tile borders, bilinear interpolation is applied 45 | def clahe_equalized(imgs): 46 | assert (len(imgs.shape)==4) #4D arrays 47 | assert (imgs.shape[1]==1) #check the channel is 1 48 | #create a CLAHE object (Arguments are optional). 49 | clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8)) 50 | imgs_equalized = np.empty(imgs.shape) 51 | for i in range(imgs.shape[0]): 52 | imgs_equalized[i,0] = clahe.apply(np.array(imgs[i,0], dtype = np.uint8)) 53 | return imgs_equalized 54 | 55 | 56 | # ===== 规范化数据集 =====# 57 | def dataset_normalized(imgs): 58 | assert (len(imgs.shape)==4) #4D arrays 59 | assert (imgs.shape[1]==1) #check the channel is 1 60 | imgs_normalized = np.empty(imgs.shape) 61 | imgs_std = np.std(imgs) 62 | imgs_mean = np.mean(imgs) 63 | imgs_normalized = (imgs-imgs_mean)/imgs_std 64 | for i in range(imgs.shape[0]): 65 | imgs_normalized[i] = ((imgs_normalized[i] - np.min(imgs_normalized[i])) / (np.max(imgs_normalized[i])-np.min(imgs_normalized[i])))*255 66 | return imgs_normalized 67 | 68 | #====== 伽马变化 ======# 69 | def adjust_gamma(imgs, gamma=1.0): 70 | assert (len(imgs.shape)==4) #4D arrays 71 | assert (imgs.shape[1]==1) #check the channel is 1 72 | # build a lookup table mapping the pixel values [0, 255] to 73 | # their adjusted gamma values 74 | invGamma = 1.0 / gamma 75 | table = np.array([((i / 255.0) ** invGamma) * 255 for i in np.arange(0, 256)]).astype("uint8") 76 | # apply gamma correction using the lookup table 77 | new_imgs = np.empty(imgs.shape) 78 | for i in range(imgs.shape[0]): 79 | new_imgs[i,0] = cv2.LUT(np.array(imgs[i,0], dtype = np.uint8), table) 80 | return new_imgs 81 | 82 | if __name__ == '__main__': 83 | print("预处理图像成功") 84 | 85 | 86 | -------------------------------------------------------------------------------- /codes/prepare_datasets_DRIVE.py: -------------------------------------------------------------------------------- 1 | #============================================================ 2 | # 3 | # This prepare the hdf5 datasets of the DRIVE database 4 | # 5 | #============================================================ 6 | 7 | import os 8 | import h5py 9 | import numpy as np 10 | from PIL import Image 11 | 12 | 13 | 14 | def write_hdf5(arr,outfile): 15 | with h5py.File(outfile,"w") as f: 16 | f.create_dataset("image", data=arr, dtype=arr.dtype) 17 | 18 | 19 | #------------Path of the images -------------------------------------------------------------- 20 | #train 21 | original_imgs_train = "../data/DRIVE/training/images/" 22 | groundTruth_imgs_train = "../data/DRIVE/training/1st_manual/" 23 | borderMasks_imgs_train = "../data/DRIVE/training/mask/" 24 | 25 | #test 26 | original_imgs_test = "../data/DRIVE/test/images/" 27 | groundTruth_imgs_test = "../data/DRIVE/test/1st_manual/" 28 | borderMasks_imgs_test = "../data/DRIVE/test/mask/" 29 | #--------------------------------------------------------------------------------------------- 30 | 31 | Nimgs = 20 32 | channels = 3 33 | height = 584 34 | width = 565 35 | dataset_path = "../data/DRIVE_datasets_training_testing/" 36 | 37 | def get_datasets(imgs_dir, groundTruth_dir, borderMasks_dir, train_test="null"): 38 | imgs = np.empty((Nimgs, height, width, channels)) 39 | groundTruth = np.empty((Nimgs, height, width)) 40 | border_masks = np.empty((Nimgs, height, width)) 41 | for path, subdirs, files in os.walk(imgs_dir): #list all files, directories in the path 42 | for i in range(len(files)): 43 | #original 44 | print("original image: " +files[i]) 45 | img = Image.open(imgs_dir+files[i]) 46 | imgs[i] = np.asarray(img) 47 | #corresponding ground truth 48 | groundTruth_name = files[i][0:2] + "_manual1.gif" 49 | print("ground truth name: " + groundTruth_name) 50 | g_truth = Image.open(groundTruth_dir + groundTruth_name) 51 | groundTruth[i] = np.asarray(g_truth) 52 | #corresponding border masks 53 | border_masks_name = "" 54 | if train_test=="train": 55 | border_masks_name = files[i][0:2] + "_training_mask.gif" 56 | elif train_test=="test": 57 | border_masks_name = files[i][0:2] + "_test_mask.gif" 58 | else: 59 | print("specify if train or test!!") 60 | exit() 61 | print("border masks name: " + border_masks_name) 62 | b_mask = Image.open(borderMasks_dir + border_masks_name) 63 | border_masks[i] = np.asarray(b_mask) 64 | 65 | print("imgs max: " +str(np.max(imgs))) 66 | print("imgs min: " +str(np.min(imgs))) 67 | assert(np.max(groundTruth)==255 and np.max(border_masks)==255) 68 | assert(np.min(groundTruth)==0 and np.min(border_masks)==0) 69 | print("ground truth and border masks are correctly within pixel value range 0-255 (black-white)") 70 | #reshaping for my standard tensors 71 | imgs = np.transpose(imgs,(0,3,1,2)) 72 | assert(imgs.shape == (Nimgs,channels,height,width)) 73 | groundTruth = np.reshape(groundTruth, (Nimgs,1,height,width)) 74 | border_masks = np.reshape(border_masks, (Nimgs,1,height,width)) 75 | assert(groundTruth.shape == (Nimgs,1,height,width)) 76 | assert(border_masks.shape == (Nimgs,1,height,width)) 77 | return imgs, groundTruth, border_masks 78 | 79 | #===== 创建文件夹,用于存放数据集文件 ===== 80 | if not os.path.exists(dataset_path): 81 | os.makedirs(dataset_path) 82 | 83 | #========= getting the training datasets ========= 84 | imgs_train, groundTruth_train, border_masks_train = get_datasets(original_imgs_train, groundTruth_imgs_train, borderMasks_imgs_train, "train") 85 | print("saving train datasets") 86 | write_hdf5(imgs_train, dataset_path + "DRIVE_dataset_imgs_train.hdf5") 87 | write_hdf5(groundTruth_train, dataset_path + "DRIVE_dataset_groundTruth_train.hdf5") 88 | write_hdf5(border_masks_train, dataset_path + "DRIVE_dataset_borderMasks_train.hdf5") 89 | 90 | #============ getting the testing datasets =========== 91 | imgs_test, groundTruth_test, border_masks_test = get_datasets(original_imgs_test,groundTruth_imgs_test,borderMasks_imgs_test,"test") 92 | print("saving test datasets") 93 | write_hdf5(imgs_test, dataset_path + "DRIVE_dataset_imgs_test.hdf5") 94 | write_hdf5(groundTruth_test, dataset_path + "DRIVE_dataset_groundTruth_test.hdf5") 95 | write_hdf5(border_masks_test, dataset_path + "DRIVE_dataset_borderMasks_test.hdf5") 96 | -------------------------------------------------------------------------------- /codes/retinaNN_predict.py: -------------------------------------------------------------------------------- 1 | #Python 2 | import numpy as np 3 | import configparser 4 | from matplotlib import pyplot as plt 5 | #Keras 6 | from keras.models import model_from_json 7 | from keras.models import Model 8 | #scikit learn 9 | from sklearn.metrics import roc_curve 10 | from sklearn.metrics import roc_auc_score 11 | from sklearn.metrics import confusion_matrix 12 | from sklearn.metrics import precision_recall_curve 13 | from sklearn.metrics import jaccard_similarity_score 14 | from sklearn.metrics import f1_score 15 | 16 | # help_functions.py 17 | from help_functions import * 18 | # extract_patches.py 19 | from extract_patches import recompone 20 | from extract_patches import recompone_overlap 21 | from extract_patches import paint_border 22 | from extract_patches import kill_border 23 | from extract_patches import pred_only_FOV 24 | from extract_patches import get_data_testing 25 | from extract_patches import get_data_testing_overlap 26 | # pre_processing.py 27 | from pre_processing import my_PreProc 28 | 29 | 30 | #################配置文件读取################# 31 | config = configparser.RawConfigParser() 32 | config.read('./configuration.txt') 33 | ################################## 34 | # run the training on invariant or local 35 | path_data = config.get('data paths', 'path_local') 36 | 37 | # original test images (for FOV selection) 38 | DRIVE_test_imgs_original = path_data + config.get('data paths', 'test_imgs_original') 39 | test_imgs_orig = load_hdf5(DRIVE_test_imgs_original) 40 | full_img_height = test_imgs_orig.shape[2] 41 | full_img_width = test_imgs_orig.shape[3] 42 | #the border masks provided by the DRIVE 43 | DRIVE_test_border_masks = path_data + config.get('data paths', 'test_border_masks') 44 | test_border_masks = load_hdf5(DRIVE_test_border_masks) 45 | # dimension of the patches 46 | patch_height = int(config.get('data attributes', 'patch_height')) 47 | patch_width = int(config.get('data attributes', 'patch_width')) 48 | #the stride in case output with average 49 | stride_height = int(config.get('testing settings', 'stride_height')) 50 | stride_width = int(config.get('testing settings', 'stride_width')) 51 | assert (stride_height < patch_height and stride_width < patch_width) 52 | #model name 53 | name_experiment = config.get('experiment name', 'name') 54 | path_experiment = '../' +name_experiment +'/' 55 | #N full images to be predicted 56 | Imgs_to_test = int(config.get('testing settings', 'full_images_to_test')) 57 | #Grouping of the predicted images 58 | N_visual = int(config.get('testing settings', 'N_group_visual')) 59 | #====== average mode =========== 60 | average_mode = config.getboolean('testing settings', 'average_mode') 61 | 62 | 63 | # #ground truth 64 | # gtruth= path_data + config.get('data paths', 'test_groundTruth') 65 | # img_truth= load_hdf5(gtruth) 66 | # visualize(group_images(test_imgs_orig[0:20,:,:,:],5),'original')#.show() 67 | # visualize(group_images(test_border_masks[0:20,:,:,:],5),'borders')#.show() 68 | # visualize(group_images(img_truth[0:20,:,:,:],5),'gtruth')#.show() 69 | 70 | 71 | 72 | #============ 加载数据并分成补丁 73 | patches_imgs_test = None 74 | new_height = None 75 | new_width = None 76 | masks_test = None 77 | patches_masks_test = None 78 | if average_mode == True: 79 | patches_imgs_test, new_height, new_width, masks_test = get_data_testing_overlap( 80 | DRIVE_test_imgs_original = DRIVE_test_imgs_original, #original 81 | DRIVE_test_groudTruth = path_data + config.get('data paths', 'test_groundTruth'), #masks 82 | Imgs_to_test = int(config.get('testing settings', 'full_images_to_test')), 83 | patch_height = patch_height, 84 | patch_width = patch_width, 85 | stride_height = stride_height, 86 | stride_width = stride_width 87 | ) 88 | else: 89 | patches_imgs_test, patches_masks_test = get_data_testing( 90 | DRIVE_test_imgs_original = DRIVE_test_imgs_original, #original 91 | DRIVE_test_groudTruth = path_data + config.get('data paths', 'test_groundTruth'), #masks 92 | Imgs_to_test = int(config.get('testing settings', 'full_images_to_test')), 93 | patch_height = patch_height, 94 | patch_width = patch_width, 95 | ) 96 | 97 | 98 | #================ 运行补丁的预测 ================================== 99 | best_last = config.get('testing settings', 'best_last') 100 | #Load the saved model 101 | model = model_from_json(open(path_experiment+name_experiment +'_architecture.json').read()) 102 | model.load_weights(path_experiment+name_experiment + '_'+best_last+'_weights.h5') 103 | #Calculate the predictions 104 | predictions = model.predict(patches_imgs_test, batch_size=32, verbose=2) 105 | print("predicted images size :") 106 | print(predictions.shape) 107 | 108 | #===== 转换相应图像中的预测数组 ====== 109 | pred_patches = pred_to_imgs(predictions, patch_height, patch_width, "original") 110 | 111 | 112 | 113 | #========== 精心制作并可视化预测图像 ==================== 114 | pred_imgs = None 115 | orig_imgs = None 116 | gtruth_masks = None 117 | if average_mode == True: 118 | pred_imgs = recompone_overlap(pred_patches, new_height, new_width, stride_height, stride_width)# predictions 119 | orig_imgs = my_PreProc(test_imgs_orig[0:pred_imgs.shape[0],:,:,:]) #originals 120 | gtruth_masks = masks_test #ground truth masks 121 | else: 122 | pred_imgs = recompone(pred_patches,13,12) # predictions 123 | orig_imgs = recompone(patches_imgs_test,13,12) # originals 124 | gtruth_masks = recompone(patches_masks_test,13,12) #masks 125 | # apply the DRIVE masks on the repdictions #set everything outside the FOV to zero!! 126 | kill_border(pred_imgs, test_border_masks) #DRIVE MASK #only for visualization 127 | ## back to original dimensions 128 | orig_imgs = orig_imgs[:,:,0:full_img_height,0:full_img_width] 129 | pred_imgs = pred_imgs[:,:,0:full_img_height,0:full_img_width] 130 | gtruth_masks = gtruth_masks[:,:,0:full_img_height,0:full_img_width] 131 | print("Orig imgs shape: " +str(orig_imgs.shape)) 132 | print("pred imgs shape: " +str(pred_imgs.shape)) 133 | print("Gtruth imgs shape: " +str(gtruth_masks.shape)) 134 | visualize(group_images(orig_imgs,N_visual),path_experiment+"all_originals")#.show() 135 | visualize(group_images(pred_imgs,N_visual),path_experiment+"all_predictions")#.show() 136 | visualize(group_images(gtruth_masks,N_visual),path_experiment+"all_groundTruths")#.show() 137 | #visualize results comparing mask and prediction: 138 | assert (orig_imgs.shape[0]==pred_imgs.shape[0] and orig_imgs.shape[0]==gtruth_masks.shape[0]) 139 | N_predicted = orig_imgs.shape[0] 140 | group = N_visual 141 | assert (N_predicted%group==0) 142 | for i in range(int(N_predicted/group)): 143 | orig_stripe = group_images(orig_imgs[i*group:(i*group)+group,:,:,:],group) 144 | masks_stripe = group_images(gtruth_masks[i*group:(i*group)+group,:,:,:],group) 145 | pred_stripe = group_images(pred_imgs[i*group:(i*group)+group,:,:,:],group) 146 | total_img = np.concatenate((orig_stripe,masks_stripe,pred_stripe),axis=0) 147 | visualize(total_img,path_experiment+name_experiment +"_Original_GroundTruth_Prediction"+str(i))#.show() 148 | 149 | 150 | #====== 评估结果 151 | print("\n\n======================= Evaluate the results =======================") 152 | #predictions only inside the FOV 153 | y_scores, y_true = pred_only_FOV(pred_imgs,gtruth_masks, test_border_masks) #returns data only inside the FOV 154 | print("Calculating results only inside the FOV:") 155 | print("y scores pixels: " +str(y_scores.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(pred_imgs.shape[0]*pred_imgs.shape[2]*pred_imgs.shape[3]) +" (584*565==329960)") 156 | print("y true pixels: " +str(y_true.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(gtruth_masks.shape[2]*gtruth_masks.shape[3]*gtruth_masks.shape[0])+" (584*565==329960)") 157 | 158 | # ROC曲线下面积 159 | fpr, tpr, thresholds = roc_curve((y_true), y_scores) 160 | AUC_ROC = roc_auc_score(y_true, y_scores) 161 | # test_integral = np.trapz(tpr,fpr) #trapz is numpy integration 162 | print("\nArea under the ROC curve: " +str(AUC_ROC)) 163 | roc_curve =plt.figure() 164 | plt.plot(fpr,tpr,'-',label='Area Under the Curve (AUC = %0.4f)' % AUC_ROC) 165 | plt.title('ROC curve') 166 | plt.xlabel("FPR (False Positive Rate)") 167 | plt.ylabel("TPR (True Positive Rate)") 168 | plt.legend(loc="lower right") 169 | plt.savefig(path_experiment+"ROC.png") 170 | 171 | #Precision-recall curve 172 | precision, recall, thresholds = precision_recall_curve(y_true, y_scores) 173 | precision = np.fliplr([precision])[0] #so the array is increasing (you won't get negative AUC) 174 | recall = np.fliplr([recall])[0] #so the array is increasing (you won't get negative AUC) 175 | AUC_prec_rec = np.trapz(precision,recall) 176 | print("\nArea under Precision-Recall curve: " +str(AUC_prec_rec)) 177 | prec_rec_curve = plt.figure() 178 | plt.plot(recall,precision,'-',label='Area Under the Curve (AUC = %0.4f)' % AUC_prec_rec) 179 | plt.title('Precision - Recall curve') 180 | plt.xlabel("Recall") 181 | plt.ylabel("Precision") 182 | plt.legend(loc="lower right") 183 | plt.savefig(path_experiment+"Precision_recall.png") 184 | 185 | #Confusion matrix 186 | threshold_confusion = 0.5 187 | print("\nConfusion matrix: Costum threshold (for positive) of " +str(threshold_confusion)) 188 | y_pred = np.empty((y_scores.shape[0])) 189 | for i in range(y_scores.shape[0]): 190 | if y_scores[i]>=threshold_confusion: 191 | y_pred[i]=1 192 | else: 193 | y_pred[i]=0 194 | confusion = confusion_matrix(y_true, y_pred) 195 | print(confusion) 196 | accuracy = 0 197 | if float(np.sum(confusion))!=0: 198 | accuracy = float(confusion[0,0]+confusion[1,1])/float(np.sum(confusion)) 199 | print("Global Accuracy: " +str(accuracy)) 200 | specificity = 0 201 | if float(confusion[0,0]+confusion[0,1])!=0: 202 | specificity = float(confusion[0,0])/float(confusion[0,0]+confusion[0,1]) 203 | print("Specificity: " +str(specificity)) 204 | sensitivity = 0 205 | if float(confusion[1,1]+confusion[1,0])!=0: 206 | sensitivity = float(confusion[1,1])/float(confusion[1,1]+confusion[1,0]) 207 | print("Sensitivity: " +str(sensitivity)) 208 | precision = 0 209 | if float(confusion[1,1]+confusion[0,1])!=0: 210 | precision = float(confusion[1,1])/float(confusion[1,1]+confusion[0,1]) 211 | print("Precision: " +str(precision)) 212 | 213 | #Jaccard similarity index 214 | jaccard_index = jaccard_similarity_score(y_true, y_pred, normalize=True) 215 | print("\nJaccard similarity score: " +str(jaccard_index)) 216 | 217 | #F1 score 218 | F1_score = f1_score(y_true, y_pred, labels=None, average='binary', sample_weight=None) 219 | print("\nF1 score (F-measure): " +str(F1_score)) 220 | 221 | #Save the results 222 | file_perf = open(path_experiment+'performances.txt', 'w') 223 | file_perf.write("Area under the ROC curve: "+str(AUC_ROC) 224 | + "\nArea under Precision-Recall curve: " +str(AUC_prec_rec) 225 | + "\nJaccard similarity score: " +str(jaccard_index) 226 | + "\nF1 score (F-measure): " +str(F1_score) 227 | +"\n\nConfusion matrix:" 228 | +str(confusion) 229 | +"\nACCURACY: " +str(accuracy) 230 | +"\nSENSITIVITY: " +str(sensitivity) 231 | +"\nSPECIFICITY: " +str(specificity) 232 | +"\nPRECISION: " +str(precision) 233 | ) 234 | file_perf.close() 235 | -------------------------------------------------------------------------------- /codes/retinaNN_training.py: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # 3 | # Script to: 4 | # - Load the images and extract the patches 5 | # - Define the neural network 6 | # - define the training 7 | # 8 | ################################################## 9 | 10 | 11 | import numpy as np 12 | import configparser 13 | import os 14 | from keras.models import Model 15 | from keras import losses 16 | from keras.layers import Input, Concatenate, Conv2D, MaxPooling2D, UpSampling2D, Reshape, core, Dropout, Conv2DTranspose, multiply, add 17 | from keras.layers.merge import Concatenate 18 | from keras.layers.core import Activation, Flatten 19 | from keras.layers.normalization import BatchNormalization 20 | from keras.callbacks import ModelCheckpoint, LearningRateScheduler 21 | from keras import backend as K 22 | from keras.utils.vis_utils import plot_model as plot 23 | from keras.optimizers import SGD, Adam 24 | 25 | from help_functions import * 26 | 27 | #function to obtain data for training/testing (validation) 28 | from extract_patches import get_data_training 29 | 30 | # ========= 从Config文件加载设置================== 31 | config = configparser.RawConfigParser() 32 | config.read('./configuration.txt') 33 | # 修补数据集 34 | path_data = config.get('data paths', 'path_local') 35 | 36 | # 实验名称 37 | name_experiment = config.get('experiment name', 'name') 38 | 39 | # 训练设置 40 | N_epochs = int(config.get('training settings', 'N_epochs')) 41 | 42 | batch_size = int(config.get('training settings', 'batch_size')) 43 | 44 | #============加载数据并分成补丁============================ 45 | patches_imgs_train, patches_masks_train = get_data_training( 46 | DRIVE_train_imgs_original = path_data + config.get('data paths', 'train_imgs_original'), 47 | DRIVE_train_groudTruth = path_data + config.get('data paths', 'train_groundTruth'), #masks 48 | patch_height = int(config.get('data attributes', 'patch_height')), 49 | patch_width = int(config.get('data attributes', 'patch_width')), 50 | N_subimgs = int(config.get('training settings', 'N_subimgs')), 51 | # 仅在FOV内选择切片 (default == True) 52 | inside_FOV = config.getboolean('training settings', 'inside_FOV') 53 | ) 54 | 55 | 56 | def Attention_block(gating, x, inter_shape): 57 | wg = Conv2D(inter_shape, (1, 1), padding='same', data_format='channels_first')(gating) 58 | wg = BatchNormalization()(wg) 59 | 60 | wx = Conv2D(inter_shape, (1, 1), padding='same', data_format='channels_first')(x) 61 | wx = BatchNormalization()(wx) 62 | 63 | wgx = add([wg, wx]) 64 | psi = Activation('relu')(wgx) 65 | 66 | psi = Conv2D(1, (1, 1), padding='same', data_format='channels_first')(psi) 67 | psi = BatchNormalization()(psi) 68 | psi = Activation('sigmoid')(psi) 69 | 70 | ab = multiply([psi, wx]) 71 | 72 | return ab 73 | 74 | """ 75 | def Recurrent_block(x, ch_out): 76 | x1 = Conv2D(ch_out, (3, 3), padding='same', data_format='channels_first')(x) 77 | x1 = BatchNormalization()(x1) 78 | x1 = Activation('relu')(x1) 79 | 80 | x2 = Conv2D(ch_out, (3, 3), padding='same', data_format='channels_first')(x + x1) 81 | x2 = BatchNormalization()(x2) 82 | x2 = Activation('relu')(x2) 83 | 84 | x3 = Conv2D(ch_out, (3, 3), padding='same', data_format='channels_first')(x + x2) 85 | x3 = BatchNormalization()(x3) 86 | x3 = Activation('relu')(x3) 87 | 88 | return x3 89 | """ 90 | 91 | """ 92 | def RRCNN_block(x, ch_out): 93 | x1 = Conv2D(ch_out, (1, 1), padding='same', data_format='channels_first')(x) 94 | 95 | x2 = Recurrent_block(x, ch_out) 96 | x2 = Recurrent_block(x2, ch_out) 97 | 98 | return x1 + x2 99 | """ 100 | #loss=focal_loss(gamma=2., alpha=.25) 101 | def focal_loss(gamma=2., alpha=.25): 102 | def focal_loss_fixed(y_true, y_pred): 103 | pt_1 = tf.where(tf.equal(y_true, 1), y_pred, tf.ones_like(y_pred)) 104 | pt_0 = tf.where(tf.equal(y_true, 0), y_pred, tf.zeros_like(y_pred)) 105 | return -K.sum(alpha * K.pow(1. - pt_1, gamma) * K.log(pt_1))-K.sum((1-alpha) * K.pow( pt_0, gamma) * K.log(1. - pt_0)) 106 | return focal_loss_fixed 107 | 108 | VGG_PATH = "../test/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5" 109 | 110 | #============ 定义网络结构 ============== 111 | 112 | # Attention U-net: 113 | def get_unet(n_ch,patch_height,patch_width): 114 | inputs = Input(shape=(n_ch,patch_height,patch_width)) 115 | # encoding path 116 | conv1 = Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(inputs) 117 | conv1 = Dropout(0.2)(conv1) 118 | conv1 = Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv1) # 32*48*48 119 | # 120 | pool1 = MaxPooling2D((2, 2) ,data_format='channels_first')(conv1) 121 | conv2 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool1) 122 | conv2 = Dropout(0.2)(conv2) 123 | conv2 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv2) # 64*24*24 124 | # 125 | pool2 = MaxPooling2D((2, 2) ,data_format='channels_first')(conv2) 126 | conv3 = Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool2) 127 | conv3 = Dropout(0.2)(conv3) 128 | conv3 = Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first', name='conv3')(conv3) # 128*12*12 129 | 130 | vgg = Model(inputs, conv3) 131 | vgg.load_weights(VGG_PATH, by_name=True) 132 | 133 | # decoding + concat path 134 | up1 = UpSampling2D(size=(2, 2) ,data_format='channels_first')(conv3) # 128*24*24 135 | up1 = Conv2D(64, (3, 3), padding='same', data_format='channels_first')(up1) # 64*24*24 136 | up1 = Dropout(0.2)(up1) 137 | up1 = Activation('relu')(up1) 138 | x2 = Attention_block(up1, conv2, 32) 139 | up1 = Concatenate(axis=1)([x2, up1]) 140 | conv4 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(up1) 141 | conv4 = Dropout(0.2)(conv4) 142 | conv4 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv4) 143 | # 144 | up2 = UpSampling2D(size=(2, 2) ,data_format='channels_first')(conv4) 145 | up2 = Conv2D(32, (3, 3), padding='same', data_format='channels_first')(up2) 146 | up2 = Dropout(0.2)(up2) 147 | up2 = Activation('relu')(up2) 148 | x1 = Attention_block(up2, conv1, 16) 149 | up1 = Concatenate(axis=1)([x1, up2]) 150 | conv5 = Conv2D(32, (3, 3), activation='relu', padding='same', data_format='channels_first')(up2) 151 | conv5 = Dropout(0.2)(conv5) 152 | conv5 = Conv2D(32, (3, 3), activation='relu', padding='same', data_format='channels_first')(conv5) # 32*48*48 153 | # 154 | conv6 = Conv2D(2, (1, 1), activation='relu',padding='same',data_format='channels_first')(conv5) # 2*48*48 155 | conv6 = core.Reshape((2,patch_height*patch_width))(conv6) 156 | conv6 = core.Permute((2,1))(conv6) 157 | ############ 158 | conv7 = core.Activation('softmax')(conv6) 159 | 160 | model = Model(inputs=inputs, outputs=conv7) 161 | 162 | #sgd = SGD(lr=0.001, decay=1e-6, momentum=0.3, nesterov=False) 163 | #optimizer = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) 164 | #model.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics=['accuracy']) 165 | model.compile(optimizer=Adam(lr=1e-3), loss=losses.binary_crossentropy, metrics=['accuracy']) 166 | 167 | return model 168 | 169 | 170 | """ 171 | #====== 模型二 ============ 172 | def get_unet(n_ch, patch_height, patch_width): 173 | inputs = Input(shape=(n_ch,patch_height,patch_width)) 174 | conv1 = Dropout(0.2)(Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(inputs)) 175 | conv1 = Dropout(0.2)(Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv1)) 176 | pool1 = MaxPooling2D(pool_size=(2, 2))(conv1) 177 | 178 | conv2 = Dropout(0.2)(Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool1)) 179 | conv2 = Dropout(0.2)(Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv2)) 180 | pool2 = MaxPooling2D(pool_size=(2, 2))(conv2) 181 | 182 | conv3 = Dropout(0.2)(Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool2)) 183 | conv3 = Dropout(0.2)(Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv3)) 184 | pool3 = MaxPooling2D(pool_size=(2, 2))(conv3) 185 | 186 | conv4 = Dropout(0.2)(Conv2D(256, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool3)) 187 | conv4 = Dropout(0.2)(Conv2D(256, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv4)) 188 | pool4 = MaxPooling2D(pool_size=(2, 2))(conv4) 189 | 190 | conv5 = Dropout(0.2)(Conv2D(512, (3, 3), activation='relu', padding='same',data_format='channels_first')(pool4)) 191 | conv5 = Dropout(0.2)(Conv2D(512, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv5)) 192 | 193 | up6 = concatenate([UpSampling2D(size=(2, 2))(conv5), conv4], axis=1) 194 | conv6 = Dropout(0.2)(Conv2D(256, (3, 3), activation='relu', padding='same',data_format='channels_first')(up6)) 195 | conv6 = Dropout(0.2)(Conv2D(256, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv6)) 196 | 197 | up7 = concatenate([UpSampling2D(size=(2, 2))(conv6), conv3], axis=1) 198 | conv7 = Dropout(0.2)(Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first')(up7)) 199 | conv7 = Dropout(0.2)(Conv2D(128, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv7)) 200 | 201 | up8 = concatenate([UpSampling2D(size=(2, 2))(conv7), conv2], axis=1) 202 | conv8 = Dropout(0.2)(Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(up8)) 203 | conv8 = Dropout(0.2)(Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv8)) 204 | 205 | up9 = concatenate([UpSampling2D(size=(2, 2))(conv8), conv1], axis=1) 206 | conv9 = Dropout(0.2)(Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(up9)) 207 | conv9 = Dropout(0.2)(Conv2D(32, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv9)) 208 | outputs = Conv2D(2, (1, 1), activation='relu',padding='same',data_format='channels_first')(conv9) 209 | print(outputs) 210 | outputs = core.Reshape((2, patch_height * patch_width))(outputs) 211 | outputs = core.Permute((2, 1))(outputs) 212 | outputs = core.Activation('sigmoid')(outputs) 213 | 214 | model = Model(inputs=[inputs], outputs=[outputs]) 215 | 216 | model.compile(optimizer=Adam(lr=1e-3), loss='categorical_crossentropy', metrics=['accuracy']) 217 | 218 | return model 219 | """ 220 | 221 | 222 | """ 223 | #====== 模型三 ============ 224 | def get_unet(n_ch,patch_height,patch_width): 225 | k = 3 # kernel size 226 | s = 2 # stride 227 | img_ch = n_ch # image channels 228 | out_ch = 1 # output channel 229 | img_height = patch_height 230 | img_width = patch_width 231 | n_filters = 32 232 | padding = 'same' 233 | 234 | inputs = Input(shape=(n_ch,patch_height,patch_width)) 235 | conv1 = Conv2D(n_filters, (k, k), padding=padding, data_format='channels_first')(inputs) 236 | conv1 = BatchNormalization(scale=False, axis=3)(conv1) 237 | conv1 = Activation('relu')(conv1) 238 | conv1 = Conv2D(n_filters, (k, k), padding=padding, data_format='channels_first')(conv1) 239 | conv1 = BatchNormalization(scale=False, axis=3)(conv1) 240 | conv1 = Activation('relu')(conv1) 241 | pool1 = MaxPooling2D(pool_size=(s, s))(conv1) 242 | 243 | conv2 = Conv2D(2 * n_filters, (k, k), padding=padding, data_format='channels_first')(pool1) 244 | conv2 = BatchNormalization(scale=False, axis=3)(conv2) 245 | conv2 = Activation('relu')(conv2) 246 | conv2 = Conv2D(2 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv2) 247 | conv2 = BatchNormalization(scale=False, axis=3)(conv2) 248 | conv2 = Activation('relu')(conv2) 249 | pool2 = MaxPooling2D(pool_size=(s, s))(conv2) 250 | 251 | conv3 = Conv2D(4 * n_filters, (k, k), padding=padding, data_format='channels_first')(pool2) 252 | conv3 = BatchNormalization(scale=False, axis=3)(conv3) 253 | conv3 = Activation('relu')(conv3) 254 | conv3 = Conv2D(4 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv3) 255 | conv3 = BatchNormalization(scale=False, axis=3)(conv3) 256 | conv3 = Activation('relu')(conv3) 257 | pool3 = MaxPooling2D(pool_size=(s, s))(conv3) 258 | 259 | conv4 = Conv2D(8 * n_filters, (k, k), padding=padding, data_format='channels_first')(pool3) 260 | conv4 = BatchNormalization(scale=False, axis=3)(conv4) 261 | conv4 = Activation('relu')(conv4) 262 | conv4 = Conv2D(8 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv4) 263 | conv4 = BatchNormalization(scale=False, axis=3)(conv4) 264 | conv4 = Activation('relu')(conv4) 265 | pool4 = MaxPooling2D(pool_size=(s, s))(conv4) 266 | 267 | conv5 = Conv2D(16 * n_filters, (k, k), padding=padding, data_format='channels_first')(pool4) 268 | conv5 = BatchNormalization(scale=False, axis=3)(conv5) 269 | conv5 = Activation('relu')(conv5) 270 | conv5 = Conv2D(16 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv5) 271 | conv5 = BatchNormalization(scale=False, axis=3)(conv5) 272 | conv5 = Activation('relu')(conv5) 273 | 274 | up1 = Concatenate(axis=1)([UpSampling2D(size=(s, s))(conv5), conv4]) 275 | conv6 = Conv2D(8 * n_filters, (k, k), padding=padding, data_format='channels_first')(up1) 276 | conv6 = BatchNormalization(scale=False, axis=3)(conv6) 277 | conv6 = Activation('relu')(conv6) 278 | conv6 = Conv2D(8 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv6) 279 | conv6 = BatchNormalization(scale=False, axis=3)(conv6) 280 | conv6 = Activation('relu')(conv6) 281 | 282 | up2 = Concatenate(axis=1)([UpSampling2D(size=(s, s))(conv6), conv3]) 283 | conv7 = Conv2D(4 * n_filters, (k, k), padding=padding, data_format='channels_first')(up2) 284 | conv7 = BatchNormalization(scale=False, axis=3)(conv7) 285 | conv7 = Activation('relu')(conv7) 286 | conv7 = Conv2D(4 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv7) 287 | conv7 = BatchNormalization(scale=False, axis=3)(conv7) 288 | conv7 = Activation('relu')(conv7) 289 | 290 | up3 = Concatenate(axis=1)([UpSampling2D(size=(s, s))(conv7), conv2]) 291 | conv8 = Conv2D(2 * n_filters, (k, k), padding=padding, data_format='channels_first')(up3) 292 | conv8 = BatchNormalization(scale=False, axis=3)(conv8) 293 | conv8 = Activation('relu')(conv8) 294 | conv8 = Conv2D(2 * n_filters, (k, k), padding=padding, data_format='channels_first')(conv8) 295 | conv8 = BatchNormalization(scale=False, axis=3)(conv8) 296 | conv8 = Activation('relu')(conv8) 297 | 298 | up4 = Concatenate(axis=1)([UpSampling2D(size=(s, s))(conv8), conv1]) 299 | conv9 = Conv2D(n_filters, (k, k), padding=padding, data_format='channels_first')(up4) 300 | conv9 = BatchNormalization(scale=False, axis=3)(conv9) 301 | conv9 = Activation('relu')(conv9) 302 | conv9 = Conv2D(n_filters, (k, k), padding=padding, data_format='channels_first')(conv9) 303 | conv9 = BatchNormalization(scale=False, axis=3)(conv9) 304 | conv9 = Activation('relu')(conv9) 305 | 306 | outputs = Conv2D(2, (1, 1), padding=padding, activation='relu', data_format='channels_first')(conv9) 307 | outputs = core.Reshape((2, patch_height * patch_width))(outputs) 308 | outputs = core.Permute((2, 1))(outputs) 309 | outputs = core.Activation('sigmoid')(outputs) 310 | 311 | model = Model(inputs=inputs, outputs=outputs) 312 | 313 | sgd = SGD(lr=0.001, decay=1e-6, momentum=0.3, nesterov=False) 314 | model.compile(optimizer='sgd', loss='categorical_crossentropy', metrics=['accuracy']) 315 | 316 | return model 317 | """ 318 | 319 | 320 | #========= 保存您正在为神经网络提供的样本 ========== 321 | N_sample = min(patches_imgs_train.shape[0],40) 322 | 323 | visualize(group_images(patches_imgs_train[0:N_sample,:,:,:],5),'../'+name_experiment+'/'+"sample_input_imgs")#.show() 324 | visualize(group_images(patches_masks_train[0:N_sample,:,:,:],5),'../'+name_experiment+'/'+"sample_input_masks")#.show() 325 | 326 | 327 | #=========== 构建并保存模型体系结构 ===== 328 | n_ch = patches_imgs_train.shape[1] # 灰色图像,通道数为1 329 | patch_height = patches_imgs_train.shape[2] # 长为48 330 | patch_width = patches_imgs_train.shape[3] # 宽为48 331 | 332 | model = get_unet(n_ch, patch_height, patch_width) #the U-net model 333 | print("Check: final output of the network:") 334 | print(model.output_shape) 335 | 336 | 337 | # os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/' 338 | # plot(model, to_file='./'+name_experiment+'/'+name_experiment + '_model.png') #check how the model looks like 339 | json_string = model.to_json() 340 | open('../'+name_experiment+'/'+name_experiment +'_architecture.json', 'w').write(json_string) 341 | 342 | 343 | 344 | #============ Training ================================== 345 | checkpointer = ModelCheckpoint(filepath='../'+name_experiment+'/'+name_experiment +'_best_weights.h5', verbose=1, monitor='val_loss', mode='auto', save_best_only=True)#save at each epoch if the validation decreased 346 | 347 | 348 | # def step_decay(epoch): 349 | # lrate = 0.01 #the initial learning rate (by default in keras) 350 | # if epoch==100: 351 | # return 0.005 352 | # else: 353 | # return lrate 354 | # 355 | # lrate_drop = LearningRateScheduler(step_decay) 356 | 357 | patches_masks_train = masks_Unet(patches_masks_train) # 减少内存消耗 358 | model.fit(patches_imgs_train, 359 | patches_masks_train, 360 | epochs = N_epochs, 361 | batch_size = batch_size, 362 | verbose = 1, 363 | shuffle=True, 364 | validation_split = 0.1, 365 | callbacks = [checkpointer]) 366 | 367 | #========== Save and test the last model =================== 368 | model.save_weights('../'+name_experiment+'/'+name_experiment +'_last_weights.h5', overwrite=True) 369 | #test the model 370 | # score = model.evaluate(patches_imgs_test, masks_Unet(patches_masks_test), verbose=0) 371 | # print('Test score:', score[0]) 372 | # print('Test accuracy:', score[1]) 373 | -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/01_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/01_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/02_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/02_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/03_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/03_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/04_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/04_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/05_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/05_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/06_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/06_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/07_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/07_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/08_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/08_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/09_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/09_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/10_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/10_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/11_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/11_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/12_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/12_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/13_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/13_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/14_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/14_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/15_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/15_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/16_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/16_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/17_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/17_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/18_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/18_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/19_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/19_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/1st_manual/20_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/1st_manual/20_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/01_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/01_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/02_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/02_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/03_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/03_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/04_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/04_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/05_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/05_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/06_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/06_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/07_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/07_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/08_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/08_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/09_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/09_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/10_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/10_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/11_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/11_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/12_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/12_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/13_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/13_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/14_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/14_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/15_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/15_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/16_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/16_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/17_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/17_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/18_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/18_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/19_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/19_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/2nd_manual/20_manual2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/2nd_manual/20_manual2.gif -------------------------------------------------------------------------------- /data/DRIVE/test/images/01_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/01_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/02_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/02_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/03_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/03_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/04_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/04_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/05_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/05_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/06_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/06_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/07_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/07_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/08_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/08_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/09_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/09_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/10_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/10_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/11_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/11_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/12_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/12_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/13_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/13_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/14_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/14_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/15_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/15_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/16_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/16_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/17_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/17_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/18_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/18_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/19_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/19_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/images/20_test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/images/20_test.tif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/01_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/01_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/02_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/02_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/03_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/03_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/04_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/04_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/05_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/05_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/06_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/06_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/07_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/07_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/08_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/08_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/09_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/09_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/10_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/10_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/11_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/11_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/12_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/12_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/13_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/13_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/14_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/14_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/15_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/15_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/16_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/16_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/17_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/17_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/18_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/18_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/19_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/19_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/test/mask/20_test_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/test/mask/20_test_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/21_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/21_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/22_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/22_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/23_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/23_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/24_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/24_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/25_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/25_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/26_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/26_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/27_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/27_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/28_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/28_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/29_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/29_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/30_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/30_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/31_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/31_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/32_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/32_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/33_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/33_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/34_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/34_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/35_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/35_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/36_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/36_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/37_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/37_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/38_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/38_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/39_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/39_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/1st_manual/40_manual1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/1st_manual/40_manual1.gif -------------------------------------------------------------------------------- /data/DRIVE/training/images/21_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/21_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/22_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/22_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/23_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/23_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/24_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/24_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/25_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/25_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/26_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/26_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/27_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/27_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/28_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/28_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/29_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/29_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/30_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/30_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/31_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/31_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/32_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/32_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/33_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/33_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/34_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/34_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/35_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/35_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/36_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/36_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/37_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/37_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/38_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/38_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/39_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/39_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/images/40_training.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/images/40_training.tif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/21_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/21_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/22_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/22_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/23_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/23_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/24_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/24_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/25_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/25_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/26_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/26_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/27_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/27_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/28_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/28_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/29_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/29_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/30_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/30_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/31_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/31_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/32_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/32_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/33_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/33_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/34_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/34_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/35_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/35_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/36_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/36_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/37_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/37_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/38_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/38_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/39_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/39_training_mask.gif -------------------------------------------------------------------------------- /data/DRIVE/training/mask/40_training_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kesling515/test_segmentation/cb5791b28479027ad2a27e506741c60fffe33486/data/DRIVE/training/mask/40_training_mask.gif -------------------------------------------------------------------------------- /test01.py: -------------------------------------------------------------------------------- 1 | import tensorflow as tf 2 | 3 | m1 = tf.constant([[3,3]]) 4 | m2 = tf.constant([[3],[3]]) 5 | product = tf.matmul(m1, m2) 6 | 7 | with tf.Session() as sess: 8 | resualt = sess.run(product) 9 | print(resualt) --------------------------------------------------------------------------------