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: str | None = None)
Bases:
ImageClassifier
Class 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: str) None
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: str, batch_size: int = 8, nepochs: int = 100, plot_loss: bool = True) None
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.