ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
Backend.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "reusex/vision/IMLBackend.hpp"
3
#include "reusex/vision/tensor_rt/Dataset.hpp"
4
#include "reusex/vision/tensor_rt/Sam3.hpp"
5
6
namespace
reusex::vision::tensor_rt
{
7
/* TensorRTBackend is a concrete implementation of the IMLBackend interface for
8
* TensorRT. It provides methods to create TensorRT-based models and datasets.
9
*/
10
class
TensorRTBackend
:
public
IMLBackend
{
11
public
:
12
/* Constructor for TensorRTBackend. Initializes any necessary resources for
13
* the backend. In this case, it is a default constructor.
14
*/
15
TensorRTBackend
() =
default
;
16
17
/* Destructor for TensorRTBackend. Cleans up any resources allocated by the
18
* backend. In this case, it is a default destructor.
19
* @param: type - The type of model to create (not used in this
20
* implementation).
21
* @param: modelPath - The file path to the model to be created (not used in
22
* this implementation).
23
* @param: use_cuda - Whether to use CUDA for inference (ignored for TensorRT,
24
* always uses GPU).
25
* @return: A unique pointer to an IModel instance representing the created
26
* model.
27
*/
28
std::unique_ptr<IModel>
29
create_model
(
const
Model
type,
30
const
std::filesystem::path &modelPath,
31
bool
use_cuda =
false
)
override
;
32
33
/* Creates a dataset based on the provided dataset path. This method is
34
* responsible for initializing and returning a dataset that can be used for
35
* training or inference. The dataset is created based on the specified path,
36
* which may contain the necessary data and configuration for the dataset.
37
* @param: datasetPath - The file path to the dataset to be created.
38
* @return: A unique pointer to an IDataset instance representing the created
39
* dataset.
40
*/
41
std::unique_ptr<IDataset>
42
create_dataset
(
const
std::filesystem::path &datasetPath)
override
;
43
};
44
}
// namespace reusex::vision::tensor_rt
reusex::vision::IMLBackend
Definition
IMLBackend.hpp:11
reusex::vision::tensor_rt::TensorRTBackend::create_dataset
std::unique_ptr< IDataset > create_dataset(const std::filesystem::path &datasetPath) override
reusex::vision::tensor_rt::TensorRTBackend::create_model
std::unique_ptr< IModel > create_model(const Model type, const std::filesystem::path &modelPath, bool use_cuda=false) override
reusex::vision::tensor_rt::TensorRTBackend::TensorRTBackend
TensorRTBackend()=default
reusex::vision::tensor_rt
Definition
Backend.hpp:6
reusex::vision::Model
Model
Definition
IMLBackend.hpp:9
libs
reusex
include
vision
tensor_rt
Backend.hpp
Generated by
1.16.1