ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
describe.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7// The `rux create attributes` pipeline stage (#373): for each MATERIAL passport
8// in the project, resolve its linked instance(s), crop the best sensor view of
9// their points, ask a vision-language model to describe the material, and store
10// a free-text description + arbitrary key/value attributes in ProjectDB keyed
11// by the material GUID (for MaterialPassport use).
12
13#include <cstddef>
14#include <filesystem>
15#include <string>
16
17namespace reusex::vision {
18
19struct IVlmClient;
20
26 std::string api_url = "http://localhost:11434/v1";
28 std::string model = "qwen2.5vl";
30 std::string api_key;
33 std::string instances_cloud = "instances";
35 std::string point_cloud = "cloud";
38 std::string prompt;
40 bool skip_existing = false;
42 int crop_padding = 8;
46 std::size_t max_points_per_frame = 5000;
52 int total_timeout_s = 120;
53};
54
60
65int describe(const std::filesystem::path &dbPath, const DescribeConfig &config);
66
70int describe_with_client(const std::filesystem::path &dbPath,
71 const DescribeConfig &config, IVlmClient &client);
72
73} // namespace reusex::vision
int describe_with_client(const std::filesystem::path &dbPath, const DescribeConfig &config, IVlmClient &client)
Testable core: run the stage with an injected client (no network).
int describe(const std::filesystem::path &dbPath, const DescribeConfig &config)
Run the attribute stage against the project at dbPath, constructing the concrete OpenAI-compatible cl...
std::string default_describe_prompt()
The default instruction: asks for a JSON object with a free-text description and an arbitrary attribu...
Options for the VLM attribute-extraction stage.
Definition describe.hpp:23
std::string instances_cloud
Name of the instance-label cloud used to resolve a material's points.
Definition describe.hpp:33
bool skip_existing
Skip materials that already have a stored annotation (resume runs).
Definition describe.hpp:40
int min_view_points
Minimum projected in-bounds points for a frame to be a usable view.
Definition describe.hpp:44
std::string api_url
OpenAI-compatible chat/completions base URL.
Definition describe.hpp:26
std::string api_key
Optional bearer token (cloud providers). Empty = no Authorization header.
Definition describe.hpp:30
std::size_t max_points_per_frame
Max points to reproject per frame (subsample large instances for speed).
Definition describe.hpp:46
std::string point_cloud
Name of the XYZRGB cloud index-aligned with instances_cloud.
Definition describe.hpp:35
int crop_padding
Pixels of padding around the projected instance bbox before cropping.
Definition describe.hpp:42
std::string model
Model name the endpoint routes to.
Definition describe.hpp:28
int total_timeout_s
CURL total request timeout in seconds (covers connect + send + receive).
Definition describe.hpp:52
int connect_timeout_s
CURL TCP connect timeout in seconds.
Definition describe.hpp:49
std::string prompt
Instruction sent alongside each crop.
Definition describe.hpp:38
A model that, given an image crop and a text prompt, returns structured attributes.