include_object_detection_kernels.h#
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Defined as empty because onnx-light does not require explicit
__declspec(dllexport)or__attribute__((visibility("default")))annotations — visibility is controlled at the shared-library level. The macro is provided so that vendored ONNX headers that decorate their declarations withONNX_APIcompile without modification.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace onnx_kernels
-
namespace kernel
-
class NonMaxSuppression : public onnx_light::onnx_kernels::kernel::KernelBase#
- #include <include_object_detection_kernels.h>
Reference NonMaxSuppression kernel (since opset 10 in the ai.onnx domain).
Implements the upstream NMS reference: for each (batch, class) pair the kernel sorts boxes by descending score, optionally pre-filters by
score_threshold, then greedily picks boxes whose IoU with all previously selected boxes is at mostiou_threshold. The selection is capped atmax_output_boxes_per_classper (batch, class) pair and the final output rows are emitted in the upstream order: outer loop over batches, then classes, then per-pair selection order (which itself is the descending-score insertion order).Inputs are restricted to FLOAT for
boxes/scores/iou_threshold/score_thresholdand INT64 formax_output_boxes_per_class; the optional scalar inputs (max_output_boxes_per_class,iou_threshold,score_threshold) may be omitted by passing anullptrTensorpointer tooperator(). Defaults follow the ONNX schema:max_output_boxes_per_class = 0(no output),iou_threshold = 0andscore_threshold = -inf(no score filtering).Public Functions
-
Tensor operator()(const Tensor &boxes, const Tensor &scores, const Tensor *max_output_boxes_per_class, const Tensor *iou_threshold, const Tensor *score_threshold, const Attributes &attrs) const#
Computes selected indices and returns a freshly allocated INT64 tensor of shape
(num_selected, 3). The optional scalar inputs may benullptrto indicate “not provided” (in which case their schema defaults apply).
-
inline explicit KernelBase(const KernelContext &ctx)#
Public Static Functions
-
static inline constexpr bool CanRunInPlace() noexcept#
Output element layout differs fundamentally from any input (FLOAT/INT64 mix, distinct rank and shape), so storage cannot be shared.
-
struct Attributes#
- #include <include_object_detection_kernels.h>
Attributes carried by the ONNX
NonMaxSuppressionoperator. The default matches the schema (center_point_box = 0— the[y1, x1, y2, x2]corner format).Public Members
-
int64_t center_point_box = 0#
-
int64_t center_point_box = 0#
-
Tensor operator()(const Tensor &boxes, const Tensor &scores, const Tensor *max_output_boxes_per_class, const Tensor *iou_threshold, const Tensor *score_threshold, const Attributes &attrs) const#
-
class RoiAlign : public onnx_light::onnx_kernels::kernel::KernelBase#
- #include <include_object_detection_kernels.h>
Reference RoiAlign kernel restricted to FLOAT inputs/outputs.
Public Functions
-
Tensor operator()(const Tensor &x, const Tensor &rois, const Tensor &batch_indices, const Attributes &attrs) const#
-
void operator()(const Tensor &x, const Tensor &rois, const Tensor &batch_indices, const Attributes &attrs, Tensor &output) const#
-
inline explicit KernelBase(const KernelContext &ctx)#
Public Static Functions
-
static inline constexpr bool CanRunInPlace() noexcept#
Output element layout (num_rois, C, output_height, output_width) fundamentally differs from any input, so storage cannot be shared.
-
struct Attributes#
- #include <include_object_detection_kernels.h>
Attributes carried by the ONNX
RoiAlignoperator. Defaults match the opset-16 schema;coordinate_transformation_modeshould be set to"output_half_pixel"to reproduce the legacy opset-10 behaviour.
-
Tensor operator()(const Tensor &x, const Tensor &rois, const Tensor &batch_indices, const Attributes &attrs) const#
-
class NonMaxSuppression : public onnx_light::onnx_kernels::kernel::KernelBase#
-
namespace kernel
-
namespace onnx_kernels