myria3d.models
Model
- class myria3d.models.model.Model(**kwargs)[source]
Model training, validation, test and prediction of point cloud semantic segmentation.
During training and validation, metrics are calculed based on sumbsampled points only. At test time, metrics are calculated considering all the points.
To keep this module light, a callback takes care of metric computations.
- Read the Pytorch Lightning docs:
https://pytorch-lightning.readthedocs.io/en/latest/common/lightning_module.html
- configure_optimizers()[source]
Choose what optimizers and learning-rate schedulers to use in your optimization.
- Returns
An optimizer, or a config of a scheduler and an optimizer.
- forward(batch: torch_geometric.data.batch.Batch) torch.Tensor [source]
Forward pass of neural network.
- Parameters
- Returns
targets torch.Tensor (B*N,C): logits
- Return type
torch.Tensor (B*N,1)
- predict_step(batch: torch_geometric.data.batch.Batch) dict [source]
Prediction step.
Move to CPU to avoid acucmulation of predictions into gpu memory.
- training_step(batch: torch_geometric.data.batch.Batch, batch_idx: int) dict [source]
Training step.
Interpolation
- class myria3d.models.interpolation.Interpolator(interpolation_k: int = 10, classification_dict: Dict[int, str] = {}, probas_to_save: Union[List[str], Literal['all']] = 'all', predicted_classification_channel: Optional[str] = 'PredictedClassification', entropy_channel: Optional[str] = 'entropy')[source]
A class to load, update with classification, update with probas (optionnal), and save a LAS.
- load_full_las_for_update(src_las: str, epsg: str) Tuple[numpy.ndarray, Dict] [source]
Loads a LAS and adds necessary extradim.
- reduce_predicted_logits(nb_points) Tuple[torch.Tensor, numpy.ndarray] [source]
Interpolate logits to points without predictions using an inverse-distance weightning scheme.
- Returns
interpolated logits classification
- Return type
- reduce_predictions_and_save(raw_path: str, output_dir: str, epsg: str) str [source]
Interpolate all predicted probabilites to their original points in LAS file, and save.
- Parameters
interpolation¶ (torch.Tensor, torch.Tensor) – output of _interpolate, of which we need the logits.
basename¶ – str: file basename to save it with the same one
output_dir¶ (Optional[str], optional) – Directory to save output LAS with new predicted classification, entropy,
None. (and _sphinx_paramlinks_myria3d.models.interpolation.Interpolator.reduce_predictions_and_save.probabilities. Defaults to) –
- Returns
path of the updated, saved LAS file.
- Return type