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