ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
annotate.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 <cstdint>
7#include <filesystem>
8#include <optional>
9#include <string>
10#include <vector>
11
12namespace reusex::vision {
13
16 bool use_cuda = false;
17 size_t batch_size = 16;
18 bool shuffle = false;
19 size_t num_workers = 4;
21 8;
22 bool skip_annotated = false;
23 float confidence = 0.5f;
24 std::vector<std::string>
26 std::optional<uint32_t> seed =
27 42;
28 bool video = false;
31};
32
41auto annotate(const std::filesystem::path &dbPath,
42 const std::filesystem::path &modelPath,
43 const AnnotationConfig &config = AnnotationConfig{}) -> int;
44
63inline bool is_sequence_boundary(std::size_t index, int node_id, int prev_id) {
64 return index == 0 || node_id <= prev_id;
65}
66
67} // namespace reusex::vision
auto annotate(const std::filesystem::path &dbPath, const std::filesystem::path &modelPath, const AnnotationConfig &config=AnnotationConfig{}) -> int
Run semantic annotation on sensor frames using ML models.
bool is_sequence_boundary(std::size_t index, int node_id, int prev_id)
Whether the video tracker must reset before the frame at index.
Definition annotate.hpp:63
Configuration for ML annotation inference and data loading.
Definition annotate.hpp:15
bool video
Use the stateful video-tracker path (SAM 3.1).
Definition annotate.hpp:28
bool use_cuda
Force CUDA acceleration.
Definition annotate.hpp:16
size_t num_workers
Number of worker threads (recommended: 2-4).
Definition annotate.hpp:19
std::optional< uint32_t > seed
Shuffle RNG seed (fixed=deterministic, nullopt=entropy).
Definition annotate.hpp:26
bool shuffle
Shuffle dataset before processing.
Definition annotate.hpp:18
bool skip_annotated
Skip frames that already have segmentation.
Definition annotate.hpp:22
std::vector< std::string > prompts
Concept/class prompts (empty = model default).
Definition annotate.hpp:25
size_t batch_size
Batch size for inference (recommended: 8-64).
Definition annotate.hpp:17
float confidence
Detection confidence threshold [0,1].
Definition annotate.hpp:23
size_t prefetch_batches
Batches to prefetch (recommended: 2-3x workers).
Definition annotate.hpp:20