trainSegmentation(train_data, train_mask, val_data, val_mask, model_file_path='/home/docs/checkouts/readthedocs.org/user_builds/panel-segmentation/envs/latest/lib/python3.7/site-packages/panel_segmentation/VGG16Net_ConvTranpose_complete.h5')¶
This function uses VGG16 as the base network and as a transfer learning framework to train a model that segments solar panels from a satellite image. It uses the training data and mask to learn how to predict the mask of a solar array from a satellite image. It uses the validation data to prevent overfitting and to test the prediction on the fly. The validation data is also use to validate when to save the best model during training.
nparray float) – This should be the training images.
nparray int/float) – This should be the training images mask - ground truth
nparray float) – This should be the validation images
nparray float) – This should be the validation images mask - ground truth
Hence the dimension of the four variables must be [a,b,c,d] where [a] is the number of input images, [b,c] are the dimensions of the image - 640 x 640 in this case and [d] is 3 - RGB
tf.keras.fit_generator History object) – This varaiale contains training history and statistics
tf.keras model object) – The final trianed model. Note that this may not be the best model as the best model is saved during training