|
ReUseX
0.0.1
3D Point Cloud Processing for Building Reuse
|
PyTorch Dataset for RTABMap databases. More...
#include <Dataset.hpp>


Public Member Functions | |
| TorchDataset (std::filesystem::path dbPath="") | |
| Construct TorchDataset from database path. | |
| Example | get (size_t index) |
| Get a data sample at the given index. | |
| torch::optional< size_t > | size () const |
| Get the number of samples in the dataset. | |
| void | save (std::vector< cv::Mat > imgs, torch::Tensor index) |
| Save label images for multiple nodes. | |
PyTorch Dataset for RTABMap databases.
This dataset class implements the torch::data::datasets::Dataset interface for use with PyTorch DataLoaders. It uses RTABMapDatabase internally for database access, eliminating code duplication.
Definition at line 26 of file Dataset.hpp.
| ReUseX::vision::libtorch::TorchDataset::TorchDataset | ( | std::filesystem::path | dbPath = "" | ) |
Construct TorchDataset from database path.
| dbPath | Path to RTABMap database file |
| Example ReUseX::vision::libtorch::TorchDataset::get | ( | size_t | index | ) |
Get a data sample at the given index.
Returns a torch::data::Example containing the image tensor and node ID. Images are automatically letterboxed to 640x640 for YOLO-style models.
| index | Index in the dataset (0 to size()-1) |
| void ReUseX::vision::libtorch::TorchDataset::save | ( | std::vector< cv::Mat > | imgs, |
| torch::Tensor | index ) |
Save label images for multiple nodes.
| imgs | Vector of label images to save |
| index | Tensor containing node IDs corresponding to each image |
| torch::optional< size_t > ReUseX::vision::libtorch::TorchDataset::size | ( | ) | const |
Get the number of samples in the dataset.