ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
IMLBackend.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "reusex/vision/IDataset.hpp"
3
#include "reusex/vision/IModel.hpp"
4
5
#include <filesystem>
6
7
namespace
reusex::vision
{
8
9
enum class
Model
{
yolo
,
sam3
};
10
11
class
IMLBackend
{
12
public
:
13
/* The destructor is declared as virtual to ensure that the correct destructor
14
* is called when an object of a derived class is deleted through a pointer to
15
* the base class. This is important for proper resource management and to
16
* avoid memory leaks. By declaring the destructor as virtual, we allow for
17
* polymorphic behavior, enabling the correct cleanup of resources allocated
18
* by derived classes when they are destroyed through a base class pointer. */
19
virtual
~IMLBackend
() =
default
;
20
21
/* Creates a model of the given type from the specified path.
22
*
23
* @param type The type of model to create, specified as an enum value.
24
* @param modelPath The filesystem path to the model file.
25
* @param use_cuda Whether to use CUDA for inference (defaults to false).
26
* @return A unique pointer to the created IModel object.
27
*/
28
virtual
std::unique_ptr<IModel>
29
create_model
(
const
Model
type,
const
std::filesystem::path &modelPath,
30
bool
use_cuda =
false
) = 0;
31
32
/* Creates a dataset from the specified path.
33
* @param datasetPath The filesystem path to the dataset.
34
* @return A unique pointer to the created IDataset object.
35
*/
36
virtual
std::unique_ptr<IDataset>
37
create_dataset
(
const
std::filesystem::path &datasetPath) = 0;
38
};
39
}
// namespace reusex::vision
reusex::vision::IMLBackend
Definition
IMLBackend.hpp:11
reusex::vision::IMLBackend::create_model
virtual std::unique_ptr< IModel > create_model(const Model type, const std::filesystem::path &modelPath, bool use_cuda=false)=0
reusex::vision::IMLBackend::~IMLBackend
virtual ~IMLBackend()=default
reusex::vision::IMLBackend::create_dataset
virtual std::unique_ptr< IDataset > create_dataset(const std::filesystem::path &datasetPath)=0
reusex::vision
Definition
annotate.hpp:8
reusex::vision::Model
Model
Definition
IMLBackend.hpp:9
reusex::vision::Model::yolo
@ yolo
Definition
IMLBackend.hpp:9
reusex::vision::Model::sam3
@ sam3
Definition
IMLBackend.hpp:9
libs
reusex
include
vision
IMLBackend.hpp
Generated by
1.16.1