pulsatrix
Loading...
Searching...
No Matches
video_frame_directory_dataset.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8#include <vector>
9
10#include "pulsatrix/dataset.hpp"
12
13namespace pulsatrix {
14
25public:
33 VideoFrameDirectoryDataset(const std::string& root_dir, DeviceBackend* backend);
34
35 [[nodiscard]] int64_t size() const override;
36
41 [[nodiscard]] Sample get(int64_t index) const override;
42
44 [[nodiscard]] const std::vector<std::string>& classes() const { return classes_; }
45
46private:
47 struct Entry {
48 std::string clip_dir;
49 int64_t label;
50 };
51
52 std::vector<Entry> entries_;
53 std::vector<std::string> classes_;
54 DeviceBackend* backend_;
55};
56
57} // namespace pulsatrix
Random-access dataset abstraction – pulsatrix's analogue of PyTorch's torch.utils....
Definition dataset.hpp:33
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
Dataset over a directory tree of the form root_dir/<class_name>/<clip_name>/<sequentially-named-frame...
Definition video_frame_directory_dataset.hpp:24
VideoFrameDirectoryDataset(const std::string &root_dir, DeviceBackend *backend)
Sample get(int64_t index) const override
const std::vector< std::string > & classes() const
Sorted class names; classes()[i] is the human-readable name for label i.
Definition video_frame_directory_dataset.hpp:44
int64_t size() const override
Number of samples in this dataset.
Random-access dataset abstraction – Sample, Dataset (size()/get()).
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
One dataset sample: an ordered list of Tensor fields (e.g. {features, label} or {image,...
Definition dataset.hpp:19