panel_segmentation.panel_train.TrainPanelSegmentationModel.trainSegmentation

TrainPanelSegmentationModel.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')[source]

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.

Parameters
  • train_data (nparray float) – This should be the training images.

  • train_mask (nparray int/float) – This should be the training images mask - ground truth

  • val_data (nparray float) – This should be the validation images

  • val_mask (nparray float) – This should be the validation images mask - ground truth

Notes

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

Returns

  • results (tf.keras.fit_generator History object) – This varaiale contains training history and statistics

  • custom_model (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