b1_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b1r.tif'
b2_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b2r.tif'
b3_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b3r.tif'
b4_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b4r.tif'
b5_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b5r.tif'
b7_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/clip_b7r.tif'
ndvi_11 = '/Volumes/ga87rif/Study Project/satelite images/Level-2/2011/ndvi.tif'

#-----------------------------------------------------------------------------------------------
# read all train and test sample points

#2009
#0.1 percent sample data
#train
train09 = functions.read_class(
    tabular_data=file_train09_dbf,
    gt_array_file='/Volumes/ga87rif/Study Project/Samples/A_train09.npy')
#test
test09 = functions.read_class(
    tabular_data=file_test09_dbf,
    gt_array_file='/Volumes/ga87rif/Study Project/Samples/A_test09.npy')

#2011
#0.1 percent sample data
#train
train11 = functions.read_class(
    tabular_data=file_train11_dbf,
    gt_array_file='/Volumes/ga87rif/Study Project/Samples/A_train11.npy')
#test
test11 = functions.read_class(
    tabular_data=file_test11_dbf,
import cv2
from serial.tools import list_ports
from random import randint
import os
import functions
from matplotlib import pylab

show = True
test = True
image_quant = 7
MDK = False

#%%Load class

path_class = "imagenet_class.txt"
dic_class = functions.read_class(path_class)

#%% image charge

#Load path

#PC UNIVERSIDAD
dir_path_images = r'''PATH_IMAGENET'''
dir_image = r'''PATH_IMAGES_IMAGENET'''
name_labels = r'''PATH_LABELS_IMAGENET'''

f = open(dir_path_images + name_labels, 'r')
labels = f.read()
labels = labels.split('\n')
name_image = []
label_image = []
#sat image 2011
b1_11 = 'L2 imagery/2011/clip_b1r.tif'
b2_11 = 'L2 imagery/2011/clip_b2r.tif'
b3_11 = 'L2 imagery/2011/clip_b3r.tif'
b4_11 = 'L2 imagery/2011/clip_b4r.tif'
b5_11 = 'L2 imagery/2011/clip_b5r.tif'
b7_11 = 'L2 imagery/2011/clip_b7r.tif'
ndvi_11 = 'L2 imagery/2011/ndvi.tif'

#-----------------------------------------------------------------------------------------------
# read all train and test sample points

#2009
#0.1 percent sample data
#train
train09 = functions.read_class(tabular_data=file_train09_dbf,
                               gt_array_file='Samples/SLC off/B_train09.npy')
#test
test09 = functions.read_class(tabular_data=file_test09_dbf,
                              gt_array_file='Samples/SLC off/B_test09.npy')

#2011
#0.1 percent sample data
#train
train11 = functions.read_class(tabular_data=file_train11_dbf,
                               gt_array_file='Samples/SLC off/B_train11.npy')
#test
test11 = functions.read_class(tabular_data=file_test11_dbf,
                              gt_array_file='Samples/SLC off/B_test11.npy')

#-----------------------------------------------------------------------------------------------
#read raster values and combine them into train_array (training datasets)