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 "
../global-params.hpp
"
7
8
#include <reusex/vision/annotate.hpp>
9
10
#include <CLI/CLI.hpp>
11
#include <cstdint>
12
#include <filesystem>
13
#include <memory>
14
#include <string>
15
16
namespace
fs = std::filesystem;
17
18
struct
SubcommandAnnotateOptions
{
19
20
fs::path
net_path
= fs::current_path() /
"yolov8x-seg.torchscript"
;
21
22
bool
isCuda
{
false
};
23
24
// Dataloader configuration
25
size_t
batch_size
= 16;
// Batch size for inference (recommended: 8-64)
26
bool
shuffle
=
false
;
// Shuffle dataset (rarely needed for inference)
27
size_t
num_workers
= 4;
// Number of worker threads (recommended: 2-4)
28
size_t
prefetch_batches
=
29
8;
// Batches to prefetch (recommended: 2-3x workers)
30
bool
skip_annotated
=
false
;
// Skip already-annotated frames (resume mode)
31
float
confidence
= 0.5f;
// Detection confidence threshold [0,1]
32
// Open-vocabulary concept prompts = the classes to detect. --prompts is a
33
// comma-separated list; --prompts-file is one concept per line (# comments
34
// allowed). Empty leaves the model's built-in default class list.
35
std::string
prompts
;
// comma-separated concept list
36
std::string
prompts_file
;
// path to a file with one concept per line
37
bool
video
=
false
;
// Use stateful video-tracker path (SAM 3.1). Forces
38
// ordered single-threaded processing.
39
40
// Shuffle RNG seed. Fixed by default so shuffled runs are reproducible
41
// (docs/STANDARDS.md ยง6). --random-seed opts into entropy instead.
42
uint32_t
seed
= 42;
43
bool
random_seed
=
false
;
// Seed from std::random_device (non-deterministic)
44
45
// Glass depth filter (batch path only; ignored in --video / SAM3.1 mode).
46
bool
glass_filter
=
false
;
// Detect glass/mirror pixels and emit per-frame
47
// confidence maps consumed by 'rux create clouds'.
48
float
glass_threshold
=
reusex::vision::AnnotationConfig
{}.
glass_threshold
;
49
};
50
51
// Function declarations.
52
void
setup_subcommand_create_annotate
(CLI::App &app,
53
std::shared_ptr<RuxOptions> global_opt);
54
int
run_subcommand_annotate
(
SubcommandAnnotateOptions
const
&opt,
55
const
RuxOptions
&global_opt);
setup_subcommand_create_annotate
void setup_subcommand_create_annotate(CLI::App &app, std::shared_ptr< RuxOptions > global_opt)
run_subcommand_annotate
int run_subcommand_annotate(SubcommandAnnotateOptions const &opt, const RuxOptions &global_opt)
global-params.hpp
RuxOptions
Definition
global-params.hpp:44
SubcommandAnnotateOptions
Definition
annotate.hpp:18
SubcommandAnnotateOptions::seed
uint32_t seed
Definition
annotate.hpp:42
SubcommandAnnotateOptions::net_path
fs::path net_path
Definition
annotate.hpp:20
SubcommandAnnotateOptions::prompts_file
std::string prompts_file
Definition
annotate.hpp:36
SubcommandAnnotateOptions::num_workers
size_t num_workers
Definition
annotate.hpp:27
SubcommandAnnotateOptions::confidence
float confidence
Definition
annotate.hpp:31
SubcommandAnnotateOptions::prefetch_batches
size_t prefetch_batches
Definition
annotate.hpp:28
SubcommandAnnotateOptions::batch_size
size_t batch_size
Definition
annotate.hpp:25
SubcommandAnnotateOptions::random_seed
bool random_seed
Definition
annotate.hpp:43
SubcommandAnnotateOptions::skip_annotated
bool skip_annotated
Definition
annotate.hpp:30
SubcommandAnnotateOptions::glass_filter
bool glass_filter
Definition
annotate.hpp:46
SubcommandAnnotateOptions::glass_threshold
float glass_threshold
Definition
annotate.hpp:48
SubcommandAnnotateOptions::video
bool video
Definition
annotate.hpp:37
SubcommandAnnotateOptions::shuffle
bool shuffle
Definition
annotate.hpp:26
SubcommandAnnotateOptions::prompts
std::string prompts
Definition
annotate.hpp:35
SubcommandAnnotateOptions::isCuda
bool isCuda
Definition
annotate.hpp:22
reusex::vision::AnnotationConfig
Configuration for ML annotation inference and data loading.
Definition
annotate.hpp:15
reusex::vision::AnnotationConfig::glass_threshold
float glass_threshold
Per-class confidence threshold for glass detections.
Definition
annotate.hpp:39
apps
rux
include
create
annotate.hpp
Generated by
1.18.0