import numpy as np import matplotlib.pyplot as plt from py.main import imageLoader fileName = "./trainingData/cy5.bin_img3_1/13227_41_41_1_cy5.bin.npy" allImages = imageLoader(fileName) allImages.shape plt.figure() plt.imshow(allImages[19]) plt.colorbar() plt.grid(False) plt.show()
from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.regularizers import l1 import matplotlib.pyplot as plt from skimage import transform import random print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU'))) modelName = 'cy5_2' imageFileName = "../trainingData/cy5.bin_img3_1/19076_41_41_1_cy5.bin.npy" labelFileName = "../trainingData/cy5.bin_img3_1/cy5.bin_19076_label.csv" #traceFileName = "./trainingData/cell_types_R3J/R3J_7238.csv" # Prepare the image for the LSTM image = imageLoader(imageFileName) imageIndex = image.shape[0] imageIndex = np.random.permutation(range(imageIndex)) imageFeature = image[imageIndex, ...] # Prepare the labels labels = pd.read_csv(labelFileName, index_col=0) labels = labels.iloc[imageIndex, ] #labels.iloc[:,0] = labels.iloc[:,0] - 1 #labels = labels.iloc[:,0].astype('category') labels = np.asarray(labels, dtype='uint8') np.asmatrix(np.unique(labels, return_counts=True)) uniqueLabels = np.unique(labels)
from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.regularizers import l1 print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU'))) modelName = 'label' imageFileName1 = "../trainingData/cell_types_img1_123/7238_41_41_3_cell_types.npy" labelFileName1 = '../trainingData/cell_types_label.csv' #imageFileName2 = "../trainingData/binaryData_gfp.bin_cy5.bin_img2_123/8127_41_41_3_gfp.bin_cy5.bin.npy" #labelFileName2 = "../trainingData/binaryData_gfp.bin_cy5.bin_img2_123/gfp.bin_cy5.bin_8127_label.csv" #traceFileName = "./trainingData/cell_types_R3J/R3J_7238.csv" # Prepare the image for the LSTM image1 = imageLoader(imageFileName1) imageIndex1 = image1.shape[0] imageIndex1 = np.random.permutation(range(imageIndex1)) imageFeature = image1[imageIndex1, ...] # image2 = imageLoader(imageFileName2) # imageIndex2 = image2.shape[0] # imageIndex2 = np.random.permutation(range(imageIndex2)) # imageFeature2 = image2[imageIndex2,...] #imageFeature = np.concatenate((imageFeature1, imageFeature2), axis = 0) # Prepare the labels labels = pd.read_csv(labelFileName1, index_col=0) labels = labels.iloc[imageIndex1, ] labels.iloc[:, 0] = labels.iloc[:, 0] - 1