brails.processors.facade_parser.facade_parser module

Class object to parse building facade images to get metric attributes.

class brails.processors.facade_parser.facade_parser.FacadeParser(input_data)

Bases: ImageProcessor

A class to parse facade images of buildings and predict metric attributes.

cam_elevs

Camera elevation angles.

Type:

list[float]

depthmaps

Depth maps for building images.

Type:

List[Tuple[str, Tuple[int, int], List[float]]]

footprints

Building footprints.

Type:

list[list[float, float]]

model_path

Path to the trained model.

Type:

str

street_images

Paths to the street images.

Type:

list[str]

predictions

DataFrame to store predictions.

Type:

pd.DataFrame

predict(images)

Predict building metric attributes from street-level imagery.

Parameters:

images (ImageSet) –

An object that contains camera elevations, depth maps, footprints, and street images. It should have the following .. attribute:: - images

A dictionary containing image data with keys as

image identifiers.
- dir_path

The directory path where the images are stored.

- properties

A dictionary of properties for each image,

including 'depthMap' and 'camElev'.

Returns:

A dictionary containing predictions for each image. Each entry includes:

  • ’roofEaveHeight’: The predicted roof eave height in feet, rounded to one decimal place.

  • ’buildingHeight’: The predicted building height in feet, rounded to the nearest integer.

  • ’roofPitch’: The predicted roof pitch, rounded to two decimal places.

Return type:

dict

Raises:
  • FileNotFoundError – If the model path does not exist.

  • ValueError – If the required data for predictions is missing or invalid.

Notes

  • Ensure that the input images contains valid image paths and properties.

  • The prediction process may be computationally expensive and time-consuming.

  • The method utilizes the GPU if available, and the model is unloaded from the GPU after inference.