brails.processors.cons_type_classifier.ConstructionTypeClassifier module
Class object to use or create construction type classification models.
- class brails.processors.cons_type_classifier.ConstructionTypeClassifier.ConsTypeClassifier(model_path=None)
Bases:
ImageClassifierClass for facilitating classification of different construction types.
ConsTypeClassifier is a specialized class for classifying different construction types (e.g., MAB, MAS, RCC, STL, WOD). It allows for making predictions using a pre-trained model and retraining the pre-trained model on new data. Inherits from the ImageClassifier class.
This class loads a default pre-trained model if a custom model path is not provided during initialization. It can also be retrained using new datasets.
- predict(data_dir)
Perform construction type predictions on images in the specified path.
- Args__
- data_dir (str): Path to the directory containing images to be
classified.
- retrain(data_dir, batch_size=8, nepochs=100, plot_loss=True)
Retrain the construction type classifier on new data.
- Args__
data_dir (str): Path to the directory containing training data. batch_size (int, optional): Batch size for training. Default is 8. nepochs (int, optional): Number of epochs for training. Default is
- plot_loss (bool, optional): Whether to plot the loss during
training. Default is True.