panel_segmentation.panel_train.TrainPanelSegmentationModel.trainMountingConfigClassifier

TrainPanelSegmentationModel.trainMountingConfigClassifier(train_path, val_path, device=device(type='cuda'))[source]

This function uses Faster R-CNN ResNet50 FPN as the base network and as a transfer learning framework to train a model that performs object detection on the mounting configuration of solar arrays. It uses the training data to locate and classify mounting configuration of the solar installation. It uses the validation data to prevent overfitting and to test the prediction on the fly.

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/
    …images/

    ……a_image_1.png ……a_image_2.png

    …annotations/

    ……b_image_1.xml ……b_image_2.xml

  • 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/
    …images/

    ……a_image_1.png ……a_image_2.png

    …annotations/

    ……b_image_1.xml ……b_image_2.xml

  • device (string) – This argument is passed to the Model() class in Detecto. It determines how to run the model: either on GPU via Cuda (default setting), or on CPU. Please note that running the model on GPU results in significantly faster training times.

Returns

model – The final trained mounting configuration object detection model.

Return type

detecto.core.Model object