NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-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 SEGMENTERLIB_ISEGMENTER_HPP_
19 #define SEGMENTERLIB_ISEGMENTER_HPP_
20 
21 #include <deque>
22 #include <map>
23 #include "modules/NvMultiObjectTracker/NvMultiObjectTracker_common.hpp"
24 #include "modules/NvMultiObjectTracker/NvTrackedObject.hpp"
25 
26 enum SEGMENTER_TYPES : int
27 {
29  SAM2 = 1,
30  NanoSAM = 2,
32 };
33 
36 {
37 public:
39  virtual ~ISegmenter() {}
40 
47  virtual void initialize(
48  const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream,
49  const std::shared_ptr<NvTrackedObjectManager> &targetManager
50  ) = 0;
51 
56  virtual void queryParams(NvMOTQuery &paramsQuery) = 0;
57 
62  virtual void localize(const std::map<NvMOTStreamId, NvMOTFrame *>& inputMeta) = 0;
63 
68  virtual void update(const std::map<NvMOTStreamId, NvMOTFrame *>& inputMeta) = 0;
69 
75  virtual void outputMaskObj(const std::shared_ptr<NvTrackedObject> target, NvMOTMask& mask) = 0;
76 
81  virtual void removeStream(const NvMOTStreamId videoStreamId) = 0;
82 
84  virtual bool isInitialized() = 0;
85 
87  virtual const SEGMENTER_TYPES getSegmenterType() = 0;
88 };
89 
90 #endif // SEGMENTERLIB_ISEGMENTER_HPP_
ISegmenter::outputMaskObj
virtual void outputMaskObj(const std::shared_ptr< NvTrackedObject > target, NvMOTMask &mask)=0
Output segmentation mask of a target.
NanoSAM
@ NanoSAM
NanoSAM segmenter.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:30
ISegmenter::localize
virtual void localize(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)=0
Localize and segment target in a new frame.
SEGMENTER_TYPES
SEGMENTER_TYPES
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:26
uint
unsigned int uint
Definition: sources/libs/nvmultiobjecttracker/include/modules/cuDCFv2/helper_math.h:25
ISegmenter::update
virtual void update(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)=0
Update Segmenter after data association.
DUMMY_SEGMENTER
@ DUMMY_SEGMENTER
Segmenter that performs no segmentation.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:28
ISegmenter::isInitialized
virtual bool isInitialized()=0
Report whether the module is initialized.
ISegmenter::getSegmenterType
virtual const SEGMENTER_TYPES getSegmenterType()=0
Get the configured segmenter type.
ISegmenter::removeStream
virtual void removeStream(const NvMOTStreamId videoStreamId)=0
Remove a stream's Segmenter features.
NvMOTStreamId
uint64_t NvMOTStreamId
Definition: includes/nvdstracker.h:53
_NvMOTQuery
Holds the capabilities and requirements reported by the tracker library.
Definition: includes/nvdstracker.h:420
EfficientVitSAM
@ EfficientVitSAM
EfficientViT-SAM segmenter.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:31
ISegmenter::queryParams
virtual void queryParams(NvMOTQuery &paramsQuery)=0
Populate the capabilities reported to the tracker.
ISegmenter::initialize
virtual void initialize(const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager)=0
Initialize variables and allocate memories.
ISegmenter
Defines the interface for target segmentation modules.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:35
SourceFrameInfo
Information about the input source frames for the input frame batch.
Definition: sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/NvMultiObjectTracker_common.hpp:49
_NvMOTMask
Holds the segmentaiton mask of an object.
Definition: includes/nvdstracker.h:225
ISegmenter::~ISegmenter
virtual ~ISegmenter()
Release resources owned by the ISegmenter instance.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:39
SAM2
@ SAM2
SAM2 segmenter.
Definition: sources/libs/nvmultiobjecttracker/include/modules/Segmenter/ISegmenter.hpp:29