ReUseX  0.0.1
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
Sam3Type.hpp
Go to the documentation of this file.
1#pragma once
2#include <opencv2/opencv.hpp>
3
4#include <array>
5#include <string>
6#include <utility>
7#include <vector>
8
10
11// Define BoxPrompt: <Label("pos"/"neg"), {x1, y1, x2, y2}>
12using BoxPrompt = std::pair<std::string, std::array<float, 4>>;
13
14// Single prompt unit: contains a piece of text and an optional set of boxes
16 std::string text;
17 std::vector<BoxPrompt> boxes;
18 Sam3PromptUnit() = default;
19 Sam3PromptUnit(const std::string &t, const std::vector<BoxPrompt> &b = {})
20 : text(t), boxes(b) {}
21};
22
23// Unified input struct
24struct Sam3Input {
26 cv::Mat image; // Required: input image
27 std::vector<Sam3PromptUnit>
28 prompts; // Required: all prompt words list corresponding to this image
29 Sam3Input() = default;
30 Sam3Input(const cv::Mat &img) : image(img) {}
31 Sam3Input(const cv::Mat &img, const std::vector<Sam3PromptUnit> &p,
32 float conf)
33 : image(img), prompts(p), confidence_threshold(conf) {}
34};
35} // namespace ReUseX::vision::tensor_rt
std::pair< std::string, std::array< float, 4 > > BoxPrompt
Definition Sam3Type.hpp:12
std::vector< Sam3PromptUnit > prompts
Definition Sam3Type.hpp:28
Sam3Input(const cv::Mat &img, const std::vector< Sam3PromptUnit > &p, float conf)
Definition Sam3Type.hpp:31
Sam3PromptUnit(const std::string &t, const std::vector< BoxPrompt > &b={})
Definition Sam3Type.hpp:19