panel_segmentation.panel_train.TrainPanelSegmentationModel.trainPanelClassifier

TrainPanelSegmentationModel.trainPanelClassifier(train_path, val_path, model_file_path='/home/docs/checkouts/readthedocs.org/user_builds/panel-segmentation/envs/latest/lib/python3.7/site-packages/panel_segmentation/VGG16_classification_model.h5')[source]

This function uses VGG16 as the base network and as a transfer learning framework to train a model that predicts the presence of solar panels in a satellite image. It uses the training data to learn how to predict the presence of a solar array in 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_path (string) – This is the path to the folder that contains the training images Note that the directory must be structured in this format:

    train_path/
    …has panel/

    ……a_image_1.jpg ……a_image_2.jpg

    …no panels/

    ……b_image_1.jpg ……b_image_2.jpg

  • val_path (string) – This is the path to the folder that contains the validation images Note that the directory must be structured in this format:

    val_path/
    …has panel/

    ……a_image_1.jpg ……a_image_2.jpg

    …no panels/

    ……b_image_1.jpg ……b_image_2.jpg

Returns

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

  • final_clas_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