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