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
7/* TensorRTBackend is a concrete implementation of the IMLBackend interface for
8 * TensorRT. It provides methods to create TensorRT-based models and datasets.
9 */
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
std::unique_ptr< IDataset > create_dataset(const std::filesystem::path &datasetPath) override
std::unique_ptr< IModel > create_model(const Model type, const std::filesystem::path &modelPath, bool use_cuda=false) override