ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
IVlmClient.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// Provider-agnostic interface for a vision-language model that describes an
8// image crop (#373). The concrete OpenAiCompatibleVlmClient talks to any
9// OpenAI-compatible chat/completions endpoint (local Ollama by default, or a
10// cloud provider). The interface exists so the `describe()` stage can be driven
11// by a fake client in tests without any network.
12
13#include "reusex/vision/vlm_protocol.hpp"
14
15#include <string>
16
17// Forward-declared to keep OpenCV out of this public header (STANDARDS ยง2).
18namespace cv {
19class Mat;
20}
21
22namespace reusex::vision {
23
29struct IVlmClient {
30 virtual ~IVlmClient() = default;
31
33 virtual VlmResult describe(const cv::Mat &crop,
34 const std::string &prompt) = 0;
35};
36
37} // namespace reusex::vision
Turn a 2D mask drawn on one sensor frame into a labelled 3D selection and a survey part (Segmentering...
A model that, given an image crop and a text prompt, returns structured attributes.
virtual VlmResult describe(const cv::Mat &crop, const std::string &prompt)=0
Describe crop (a BGR CV_8UC3 image) given prompt.
virtual ~IVlmClient()=default
The description + arbitrary attributes a vision-language model returned for one crop.