Computer Vision News - November 2022

35 Glaucoma and Segmentation Coding area! The dataset used in that example is the RIM-ONE and DRISHTI which you can find online (either on GitHub or various Google Drive Sources). A small introduction to the code is that it trains a UNet network, similarly as we’ve seen before and then performs a cup segmentation using two approaches. I am not including the UNet creation but you can refer to our older code articles or of course look at many great resources online if you want to modify it and create your own! Without much further ado, let’s reach the code and see for ourselves! train=True Epochs=30 preload=False hough=False rams=False dynAug=False depth = 6 print(depth,chan,ir,rand_sv,ds,zone) 6 64 1.1 42 MIX CUP Imports This is a part where you need to do all your imports. Data preparation The data from RIM-ONE and DRISHTI are prepared and modified to be ready for the model injection. Notice we are using the H5 file format for the data. Xori= np.asarray(h5f2['DRISHTI-GS/orig/images']) disc_locations = np.asarray( h5f2['DRISHTI-GS/512 px/disc_locations']) FC = np.asarray(h5f2['DRISHTI-GS/512 px/file_codes'] ) indDRI = np.arange(0,Xori.shape[0]) bsqside=np.maximum((disc_locations[:,3]-disc_locations[:,1]),(disc_locations[:,2]-disc_ locations[:,0])) isize=Xori.shape[1] Yf = np.asarray(h5f2['DRISHTI-GS/512 px/cup']) Xc = [Xori[i][index512_resize(disc_locations[i][0],isize):index512_resize(disc_ locations[i][0]+bsqside[i],isize), index512_resize(disc_locations[i][1],isize):index512_ resize(disc_locations[i][1]+bsqside[i],isize)] for i in range(len(Xori))] Yc=[Yf[i][disc_locations[i][0]:disc_locations[i][0]+bsqside[i], disc_locations[i] [1]:disc_locations[i][1]+bsqside[i]] for i in range(len(Xori))] X=[cv2.resize(img, (128, 128),interpolation=cv2.INTER_NEAREST) for img in Xc]

RkJQdWJsaXNoZXIy NTc3NzU=