Skip to main content

DetectionTypes.h File

Detection result types and helpers for decoding model outputs. More...

Included Headers

#include "pipeline/TensorCore.h" #include "pipeline/Tensor.h" #include <cstdint> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structBox

One axis-aligned detection produced by BoxDecode. More...

structBoxDecodeResult

Parsed BoxDecode output paired with its raw byte buffer. More...

Description

Detection result types and helpers for decoding model outputs.

Defines the structured output types produced after the BoxDecode postprocess stage runs. Box is a single detection (axis-aligned bbox + class + score); BoxDecodeResult bundles the parsed list with the raw byte payload it came from. The free functions parse byte-encoded BBOX tensors back into typed Box records for application code.

See Also

BoxDecodeType for the decode-family selection.

See Also

StageRun.h for the BoxDecode stage entry point.

File Listing

The file content with the documentation metadata removed is:

1
15#pragma once
16
18#include "pipeline/Tensor.h"
19
20#include <cstdint>
21#include <string>
22#include <vector>
23
24namespace simaai::neat {
25
36struct Box {
37 float x1 = 0.0f;
38 float y1 = 0.0f;
39 float x2 = 0.0f;
40 float y2 = 0.0f;
41 float score = 0.0f;
42 int class_id = -1;
43};
44
54 std::vector<Box> boxes;
55 std::vector<uint8_t> raw;
56};
57
59using BoxDecodeResultList = std::vector<BoxDecodeResult>;
60
71std::vector<Box> parse_bbox_bytes(const std::vector<uint8_t>& bytes, int img_w, int img_h,
72 int expected_topk, bool strict);
73
87BoxDecodeResult decode_bbox_tensor(const simaai::neat::Tensor& tensor, int img_w, int img_h,
88 int expected_topk, bool strict);
89
91inline constexpr int64_t kDecodedBoxColumns = 6;
92
99simaai::neat::Tensor boxes_to_tensor(const std::vector<Box>& boxes);
100
118 int img_h = 0, int top_k = 0, bool strict = false);
119
130void tag_detection_format(simaai::neat::Tensor& tensor, std::string format);
131
142
143} // namespace simaai::neat
144
145// Forward decl from Sample.h to avoid an extra include in this header.
146namespace simaai::neat {
147struct Sample;
148
160
161} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.