ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
Dataset.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6#include "reusex/vision/IData.hpp"
7#include "reusex/vision/IDataset.hpp"
8#include "reusex/vision/tensor_rt/Data.hpp"
9
11/* TensorRTDataset is a dataset class that manages TensorRTData objects. It
12 * inherits from IDataset and implements the get and save methods to handle
13 * TensorRTData instances. This class allows for efficient storage and retrieval
14 * of data in a format optimized for TensorRT operations. */
15class TensorRTDataset : public IDataset {
16 public:
18
19 /* The get method retrieves a Pair of TensorRTData objects from the dataset
20 * based on the provided index. It overrides the virtual method from the
21 * IDataset interface to return data in the specific format used by TensorRT.
22 * @param index The index of the data pair to retrieve.
23 * @return A Pair containing the input and output TensorRTData objects. */
24 IDataset::Pair get(const std::size_t index) const override;
25
26 /* The save method stores a Pair of TensorRTData objects in the dataset. It
27 * overrides the virtual method from the IDataset interface to handle data in
28 * the specific format used by TensorRT. This method allows for efficient
29 * saving of data pairs that can be later retrieved using the get method.
30 * @param data A span containing the Pair of TensorRTData objects to save.
31 * @return A boolean value indicating whether the save operation was
32 * successful. */
33 bool save(const std::span<Pair> &data) override;
34
35 private:
36 bool class_map_saved_ = false;
37};
38} // namespace reusex::vision::tensor_rt
IDataset(std::shared_ptr< ProjectDB > database)
std::pair< std::unique_ptr< IData >, size_t > Pair
Definition IDataset.hpp:44
bool save(const std::span< Pair > &data) override
IDataset(std::shared_ptr< ProjectDB > database)
IDataset::Pair get(const std::size_t index) const override