ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
Data.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 "reusex/vision/IData.hpp"
7#include "reusex/vision/tensor_rt/Sam3Type.hpp"
8
9#include <opencv2/core/mat.hpp>
10
11#include <array>
12#include <memory>
13#include <utility>
14#include <vector>
15
17
18/* TensorRTData is a struct that implements the IData interface and contains a
19 * cv::Mat image. This struct is used to store the image data that will be
20 * processed by TensorRT.
21 */
23
24 using Vec = std::array<int64_t, 32>;
25 using Prompt = std::pair<std::shared_ptr<Vec>, std::shared_ptr<Vec>>;
26
27 cv::Mat image;
28 // Default concept prompts tuned for the ReUseX use case (building interior
29 // reuse/renovation): the reusable building components a scan should catalogue
30 // — structure/envelope, openings, circulation, building services, and fixed
31 // fixtures. Movable furniture is intentionally minimal (it is not a
32 // "building" component). Override per-run with `rux create annotate
33 // --prompts` /
34 // `--prompts-file` (the prompt list IS the class set for this open-vocab
35 // model).
36 std::vector<Sam3PromptUnit> prompts = {
37 // Structure / envelope
38 Sam3PromptUnit("wall"),
39 Sam3PromptUnit("floor"),
40 Sam3PromptUnit("ceiling"),
41 Sam3PromptUnit("column"),
42 Sam3PromptUnit("beam"),
43 // Openings
44 Sam3PromptUnit("door"),
45 Sam3PromptUnit("door frame"),
46 Sam3PromptUnit("window"),
47 // Circulation
48 Sam3PromptUnit("staircase"),
49 Sam3PromptUnit("railing"),
50 // Building services
51 Sam3PromptUnit("radiator"),
52 Sam3PromptUnit("pipe"),
53 Sam3PromptUnit("duct"),
54 Sam3PromptUnit("electrical outlet"),
55 Sam3PromptUnit("ceiling light"),
56 // Fixed fixtures
57 Sam3PromptUnit("sink"),
58 Sam3PromptUnit("cabinet"),
59 Sam3PromptUnit("shelf"),
60 };
61
63
70
78
83
87 static const std::vector<std::string> &default_prompt_text_list() {
88 static const std::vector<std::string> texts{
89 "wall", "floor",
90 "ceiling", "column",
91 "beam", "door",
92 "door frame", "window",
93 "staircase", "railing",
94 "radiator", "pipe",
95 "duct", "electrical outlet",
96 "ceiling light", "sink",
97 "cabinet", "shelf"};
98 return texts;
99 }
100};
101} // namespace reusex::vision::tensor_rt
bool geometry_prompts_used
Output (on forward() results): true when the loaded engines take geometry, i.e.
Definition Data.hpp:82
std::array< int64_t, 32 > Vec
Definition Data.hpp:24
std::pair< std::shared_ptr< Vec >, std::shared_ptr< Vec > > Prompt
Definition Data.hpp:25
bool select_box_instances
Input: for a prompt with boxes or points, keep only the detections they select (vision::sam3_detectio...
Definition Data.hpp:77
std::vector< Sam3PromptUnit > prompts
Definition Data.hpp:36
static const std::vector< std::string > & default_prompt_text_list()
Returns the plain text of the built-in default prompt list so callers can merge it with extra prompts...
Definition Data.hpp:87
bool label_by_prompt_index
Input: write each detection's prompt position (0..N-1 in prompts) as its label value instead of the m...
Definition Data.hpp:69