NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_segmentation.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __POST_PROCESSOR_SEGMENTATION_HPP__
19 #define __POST_PROCESSOR_SEGMENTATION_HPP__
20 
21 #include "post_processor.h"
22 #include <functional>
23 
25 
26 public:
27  SegmentationModelPostProcessor(int id, int gpuId = 0)
29 
30  ~SegmentationModelPostProcessor() override = default;
31 
33  initResource(NvDsPostProcessContextInitParams& initParams) override;
34 
35  NvDsPostProcessStatus parseEachFrame(const std::vector <NvDsInferLayerInfo>&
36  outputLayers,
37  NvDsPostProcessFrameOutput &result) override;
38 
39  void
40  attachMetadata (NvBufSurface *surf, gint batch_idx,
41  NvDsBatchMeta *batch_meta,
42  NvDsFrameMeta *frame_meta,
43  NvDsObjectMeta *object_meta,
44  NvDsObjectMeta *parent_obj_meta,
45  NvDsPostProcessFrameOutput & detection_output,
47  std::set <gint> & filterOutClassIds,
48  int32_t unique_id,
49  gboolean output_instance_mask,
50  gboolean process_full_frame,
51  float segmentationThreshold,
52  gboolean maintain_aspect_ratio,
53  NvDsRoiMeta *roi_meta,
54  gboolean symmetric_padding) override;
55 
56 
57  void releaseFrameOutput(NvDsPostProcessFrameOutput& frameOutput) override;
58 private:
59  NvDsPostProcessStatus fillSegmentationOutput(
60  const std::vector<NvDsInferLayerInfo>& outputLayers,
62 
63  float m_SegmentationThreshold = 0.50;
65  uint32_t m_NumClasses = 0;
66 };
67 
68 #endif
NvDsPostProcessNetworkType_Segmentation
@ NvDsPostProcessNetworkType_Segmentation
Specifies a segmentation network.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:195
SegmentationModelPostProcessor::SegmentationModelPostProcessor
SegmentationModelPostProcessor(int id, int gpuId=0)
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_segmentation.h:27
NvDsPostProcessDetectionParams
Holds detection and bounding box grouping parameters.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:212
ModelPostProcessor
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor.h:51
post_processor.h
NvBufSurface
Holds information about batched buffers.
Definition: sources/includes/nvbufsurface.h:597
NvDsPostProcessStatus
NvDsPostProcessStatus
Enum for the status codes returned by NvDsPostProcessAlgorithm.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:78
NvDsPostProcessTensorOrder
NvDsPostProcessTensorOrder
Defines UFF layer orders.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:175
SegmentationModelPostProcessor::initResource
NvDsPostProcessStatus initResource(NvDsPostProcessContextInitParams &initParams) override
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition: sources/includes/nvdsmeta.h:262
SegmentationModelPostProcessor::attachMetadata
void attachMetadata(NvBufSurface *surf, gint batch_idx, NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta, NvDsObjectMeta *object_meta, NvDsObjectMeta *parent_obj_meta, NvDsPostProcessFrameOutput &detection_output, NvDsPostProcessDetectionParams *all_params, std::set< gint > &filterOutClassIds, int32_t unique_id, gboolean output_instance_mask, gboolean process_full_frame, float segmentationThreshold, gboolean maintain_aspect_ratio, NvDsRoiMeta *roi_meta, gboolean symmetric_padding) override
_NvDsPostProcessContextInitParams
Holds the initialization parameters required for the NvDsPostProcessContext interface.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:256
SegmentationModelPostProcessor
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_segmentation.h:24
NvDsPostProcessFrameOutput
Holds the information inferred by the network on one frame.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:502
NvDsPostProcessSegmentationOutput
Holds information parsed from segmentation network output for one frame.
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:461
SegmentationModelPostProcessor::parseEachFrame
NvDsPostProcessStatus parseEachFrame(const std::vector< NvDsInferLayerInfo > &outputLayers, NvDsPostProcessFrameOutput &result) override
NvDsRoiMeta
Holds Information about ROI Metadata.
Definition: sources/includes/nvds_roi_meta.h:95
SegmentationModelPostProcessor::releaseFrameOutput
void releaseFrameOutput(NvDsPostProcessFrameOutput &frameOutput) override
_NvDsFrameMeta
Holds metadata for a frame in a batch.
Definition: sources/includes/nvdsmeta.h:306
SegmentationModelPostProcessor::~SegmentationModelPostProcessor
~SegmentationModelPostProcessor() override=default
NvDsPostProcessTensorOrder_kNCHW
@ NvDsPostProcessTensorOrder_kNCHW
Definition: sources/gst-plugins/gst-nvdspostprocess/postprocesslib_impl/post_processor_struct.h:176
_NvDsObjectMeta
Holds metadata for an object in the frame.
Definition: sources/includes/nvdsmeta.h:365