from spectral import imshow from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import matplotlib.patches as patches def make_hparam_string(patch_size): return "ps%d" % patch_size # Input data print("------------------------") print("Input data") print("------------------------") input = IndianPines_Input.IndianPines_Input() print("Training pixels", np.count_nonzero(input.train_data)) print("Test pixels", np.count_nonzero(input.test_data)) print("------------------------") # Configurable parameters config = {} config['in_channels'] = input.bands config['num_classes'] = input.num_classes config['patch_size'] = 5 config['kernel_size'] = 3 config['conv1_channels'] = 32 config['conv2_channels'] = 64 config['fc1_units'] = 1024 config['batch_size'] = 16
from Flevoland import Flevoland_Input from SanFrancisco import SanFrancisco_Input from Salinas import Salinas_Input import time import numpy as np from collections import Counter from spectral import imshow, save_rgb import CV_Decoder, CV_Postprocessing import os import pandas as pd import CNNTrain_2D # Input data images = ["IndianPines", "Pavia", "Flevoland", "SanFrancisco", "Salinas"] images_inputs = { "IndianPines": IndianPines_Input.IndianPines_Input(), "Pavia": Pavia_Input.Pavia_Input(), "Flevoland": Flevoland_Input.Flevoland_Input(), "SanFrancisco": SanFrancisco_Input.SanFrancisco_Input(), "Salinas": Salinas_Input.Salinas_Input() } # Select image to test selected_img = images[3] input = images_inputs[selected_img] print("Image:" + selected_img) for patch_size in [5]: config = {}