opr.trainers.place_recognition package
Module for Place Recognition trainers.
opr.trainers.place_recognition.multimodal
Multimodal Place Recognition Trainer.
- class opr.trainers.place_recognition.multimodal.MultimodalPlaceRecognitionTrainer(modalities_weights: dict[str, float], *args, **kwargs)[source]
Bases:
UnimodalPlaceRecognitionTrainerMultimodal Place Recognition Trainer.
opr.trainers.place_recognition.unimodal
Pointcloud Place Recognition trainer.
- class opr.trainers.place_recognition.unimodal.UnimodalPlaceRecognitionTrainer(checkpoints_dir: str | PathLike, model: Module, loss_fn: Module, optimizer: Optimizer, scheduler: Any | None = None, batch_expansion_threshold: int | None = None, wandb_log: bool = False, device: str | int | device = 'cuda')[source]
Bases:
objectSingle modality Place Recognition trainer.
- property stats: Dict[str, Any]
Dictionary with statistics for the last epoch.
- test(dataloader: DataLoader, distance_threshold: float = 25.0) None[source]
Evaluates the model on the test set.
- Parameters:
dataloader (DataLoader) – The data loader for the test set.
distance_threshold (float) – The distance threshold for a correct match. Defaults to 25.0.
- train(epochs: int, train_dataloader: DataLoader, val_dataloader: DataLoader | None = None, test_dataloader: DataLoader | None = None, test_every_n_epochs: int = 1) None[source]
Trains the single modal Place Recognition model for the specified number of epochs.
- Parameters:
epochs (int) – The number of epochs to train for.
train_dataloader (DataLoader) – The data loader for the training set.
val_dataloader (Optional[DataLoader]) – The data loader for the validation set.
test_dataloader (Optional[DataLoader]) – The data loader for the test set.
test_every_n_epochs (int) – The frequency (in epochs) at which to evaluate the model on the test set.