6#include <opencv2/core.hpp>
7#include <torch/torch.h>
26class TorchDataset :
public torch::data::datasets::Dataset<TorchDataset> {
27 using Example = torch::data::Example<>;
45 Example
get(
size_t index);
51 torch::optional<size_t>
size()
const;
59 void save(std::vector<cv::Mat> imgs, torch::Tensor index);
62 std::shared_ptr<io::RTABMapDatabase> db_;
63 std::vector<int> ids_;
Core database class that wraps RTABMap's database functionality.
void save(std::vector< cv::Mat > imgs, torch::Tensor index)
Save label images for multiple nodes.
TorchDataset(std::filesystem::path dbPath="")
Construct TorchDataset from database path.
torch::optional< size_t > size() const
Get the number of samples in the dataset.
Example get(size_t index)
Get a data sample at the given index.