ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::vision::libtorch::LibTorchBackend Class Reference

LibTorch backend implementation of the IMLBackend interface. More...

#include <Backend.hpp>

Inheritance diagram for reusex::vision::libtorch::LibTorchBackend:
Collaboration diagram for reusex::vision::libtorch::LibTorchBackend:

Public Member Functions

 LibTorchBackend ()=default
std::unique_ptr< IModelcreate_model (const Model type, const std::filesystem::path &modelPath, bool use_cuda=false) override
 Create a LibTorch model.
std::unique_ptr< IDatasetcreate_dataset (const std::filesystem::path &datasetPath) override
 Create a LibTorch dataset from a database path.
Public Member Functions inherited from reusex::vision::IMLBackend
virtual ~IMLBackend ()=default

Detailed Description

LibTorch backend implementation of the IMLBackend interface.

Provides factory methods for creating LibTorch-based models and datasets for use with the backend-agnostic annotation pipeline.

Definition at line 17 of file Backend.hpp.

Constructor & Destructor Documentation

◆ LibTorchBackend()

reusex::vision::libtorch::LibTorchBackend::LibTorchBackend ( )
default

Member Function Documentation

◆ create_dataset()

std::unique_ptr< IDataset > reusex::vision::libtorch::LibTorchBackend::create_dataset ( const std::filesystem::path & datasetPath)
overridevirtual

Create a LibTorch dataset from a database path.

Parameters
datasetPathPath to the RTABMap database file.
Returns
Unique pointer to the created dataset.

Implements reusex::vision::IMLBackend.

◆ create_model()

std::unique_ptr< IModel > reusex::vision::libtorch::LibTorchBackend::create_model ( const Model type,
const std::filesystem::path & modelPath,
bool use_cuda = false )
overridevirtual

Create a LibTorch model.

Parameters
typeModel type (currently only Yolo is supported).
modelPathPath to the TorchScript model file.
use_cudaWhether to use CUDA for inference (defaults to false).
Returns
Unique pointer to the created model.
Exceptions
std::runtime_errorif model type is not supported.

Implements reusex::vision::IMLBackend.


The documentation for this class was generated from the following file: