NVIDIA DeepStream SDK API Reference

9.2 Release
9.2/service-maker/includes/metadata.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 
26 #ifndef NVIDIA_DEEPSTREAM_METADATA
27 #define NVIDIA_DEEPSTREAM_METADATA
28 
29 #include <functional>
30 #include <memory>
31 #include <string>
32 
33 #include "nvll_osd_struct.h"
34 #include "nvds_tracker_meta.h"
35 #include "nvds_audio_meta.h"
36 
37 namespace deepstream {
38 
39 #define USER_METADATA_START = (4096 + 4096 + 1)
40 
48 class Metadata {
49  public:
51  Metadata(void* data);
52 
54  virtual ~Metadata();
55 
57  virtual operator bool() { return data_ != nullptr; }
58 
59  protected:
60  void* data_; //> opaque data pointer
61 };
62 
70 template <typename T>
71 class AbstractIterator {
72  public:
74  AbstractIterator(const T& data) : data_(data) {}
75 
77  virtual ~AbstractIterator() {}
78 
80  T& operator*() { return data_; }
81 
83  T* operator->() { return &data_; }
84 
86  T& get() { return data_; }
87 
89  virtual AbstractIterator<T>& next() = 0;
90 
92  virtual bool done() = 0;
93 
95  bool operator==(const AbstractIterator<T>& other) const {
96  return equals(other);
97  }
98 
100  bool operator!=(const AbstractIterator<T>& other) const {
101  return !(*this == other);
102  }
103 
104  protected:
105  virtual bool equals(const AbstractIterator<T>& other) const = 0;
106  T data_;
107 };
108 
110 class UserMetadata : public Metadata {
111  public:
112  typedef std::unique_ptr<AbstractIterator<UserMetadata>> Iterator;
113 
120  UserMetadata(void*);
122  virtual ~UserMetadata();
123 
125  virtual operator bool() override { return data_ != nullptr; }
126 
128  int metaType() const;
130  void setMetaType(int type);
131 
133  void* userData() const;
141  void setUserData(void* data, void*(*copy)(void*, void*), void(*release)(void*, void*));
142 
143  friend class BatchMetadata;
144  friend class FrameMetadata;
145  friend class AudioFrameMetadata;
146  friend class ObjectMetadata;
147 
148  protected:
149  void get_(void*&);
150 };
151 
153 class LabelInfo {
154  public:
155  LabelInfo(void* data);
156 
158  std::string label() const;
160  unsigned int classId() const;
162  float prob() const;
164  unsigned int labelId() const;
166  unsigned int numClasses() const;
167 
168  private:
169  void* data_;
170 };
171 
173 class ClassifierMetadata : public Metadata {
174 public:
175  typedef std::unique_ptr<AbstractIterator<ClassifierMetadata>> Iterator;
176 
183  ClassifierMetadata(void* data = nullptr);
185  virtual ~ClassifierMetadata();
186 
188  unsigned int nLabels() const;
190  unsigned int uniqueComponentId() const;
192  std::string classifierType() const;
194  LabelInfo getLabelInfo(unsigned int nth) const;
196  std::string getLabel(unsigned int nth) const;
197 
198 };
199 
206 class ObjectMetadata : public Metadata {
207  public:
208  typedef std::unique_ptr<AbstractIterator<ObjectMetadata>> Iterator;
209 
216  ObjectMetadata(void* data = nullptr);
218  virtual ~ObjectMetadata();
219 
221  unsigned int uniqueComponentId() const;
222  void setUniqueComponentId(unsigned int);
224  unsigned int classId() const;
225  void setClassId(unsigned int);
227  unsigned long int objectId() const;
228  void setObjectId(unsigned long);
230  float confidence() const;
231  void setConfidence(float);
233  float trackerConfidence() const;
234  void setTrackerConfidence(float);
236  NvOSD_RectParams& rectParams() const;
237  void setRectParams(const NvOSD_RectParams&);
239  NvOSD_MaskParams& maskParams() const;
240  void setMaskParams(const NvOSD_MaskParams&);
242  NvOSD_TextParams& textParams() const;
243  void setTextParams(const NvOSD_TextParams&);
245  std::string label() const;
246  void setLabel(std::string);
248  NvBbox_Coords& nvBboxInfo() const;
249  void setNvBboxInfo(const NvBbox_Coords&);
250 
252  unsigned int iterate(const std::function<void(const ClassifierMetadata&)>& func) const;
255 
257  unsigned int iterate(const std::function<void(const UserMetadata&)>& func, int meta_type) const;
259  void initiateIterator(UserMetadata::Iterator&, int meta_type) const;
260 
262  void append(const UserMetadata&);
263 
264  friend class FrameMetadata;
265 };
266 
267 
268 class FrameMetadata;
269 class AudioFrameMetadata;
277 class EventMessageUserMetadata : public UserMetadata {
278  public:
279  EventMessageUserMetadata(void* data=nullptr);
280  virtual ~EventMessageUserMetadata();
281 
283  void generate(
284  const ObjectMetadata&,
285  const FrameMetadata&,
286  const std::string sensor="N/A",
287  const std::string uri="N/A",
288  const std::vector<std::string>labels=std::vector<std::string>());
289 
291  void generate(
292  const AudioFrameMetadata&,
293  const std::string sensor="N/A",
294  const std::string uri="N/A");
295 };
296 
303 class RoiMetadata : public Metadata {
304  public:
305  RoiMetadata(void* data=nullptr);
306  virtual ~RoiMetadata();
307 
309  NvOSD_RectParams& rectParams() const;
310 
312  FrameMetadata frameMetadata() const;
313 
315  ObjectMetadata objectMetadata() const;
316 
318  unsigned int iterate(const std::function<void(const UserMetadata&)>& func, int meta_type) const;
320  void initiateIterator(UserMetadata::Iterator&, int meta_type) const;
321 
323  unsigned int iterate(const std::function<void(const ClassifierMetadata&)>& func) const;
326 };
327 
328 
334 class Tensor;
335 class TensorOutputUserMetadata : public UserMetadata {
336  public:
337  TensorOutputUserMetadata(void* data=nullptr);
339  virtual ~TensorOutputUserMetadata();
340 
342  unsigned int uniqueId() const;
344  std::unordered_map<std::string, Tensor*> getLayers();
345 };
346 
355 class SegmentationUserMetadata: public UserMetadata {
356 public:
362  SegmentationUserMetadata(void* data=nullptr);
363 
366 
368  virtual ~SegmentationUserMetadata();
369 
371  unsigned int uniqueId() const;
372 
374  unsigned int getClasses() const;
375 
377  unsigned int getWidth() const;
378 
380  unsigned int getHeight() const;
381 
383  const int* getClassMap() const;
384 
386  const float* getClassProbabilitiesMap() const;
387 };
388 
395 template <class C, int N>
396 class UserMetadataTemplate : public UserMetadata {
397  public:
401 
402 
403  C& get() {
404  void* p = nullptr;
405  this->get_(p);
406  return *((C*)p);
407  }
408 
409  static void* copy(void* data, void* user_data) {
410  void* p = nullptr;
412  C*& src = (C*&) p;
413  C* dst = new C(*src);
414  return dst;
415  }
416 
417  static void free(void* data, void* user_data) {
418  void* p = nullptr;
420  C*& src = (C*&) p;
421  delete src;
422  p = nullptr;
423  }
424 };
425 
433 class DisplayMetadata : public Metadata {
434  public:
435  typedef std::unique_ptr<AbstractIterator<DisplayMetadata>> Iterator;
436 
443  DisplayMetadata(void* data = nullptr);
445  virtual ~DisplayMetadata();
446 
448  unsigned int nRects() const;
450  unsigned int nLabels() const;
452  unsigned int nLines() const;
454  unsigned int nArrows() const;
456  unsigned int nCircles() const;
457 
459  bool add(NvOSD_TextParams&);
461  bool add(NvOSD_RectParams&);
463  bool add(NvOSD_LineParams&);
465  bool add(NvOSD_ArrowParams&);
467  bool add(NvOSD_CircleParams&);
468 
469  friend class FrameMetadata;
470 };
471 
478 class FrameMetadata : public Metadata {
479  public:
480  typedef std::unique_ptr<AbstractIterator<FrameMetadata>> Iterator;
481 
488  FrameMetadata(void* data=nullptr);
490  virtual ~FrameMetadata();
491 
493  unsigned int iterate(const std::function<void(const ObjectMetadata&)>& func) const;
496 
498  unsigned int iterate(const std::function<void(const DisplayMetadata&)>& func) const;
501 
503  unsigned int iterate(const std::function<void(const UserMetadata&)>& func, int meta_type) const;
505  void initiateIterator(UserMetadata::Iterator&, int meta_type) const;
506 
508  unsigned int padIndex() const;
510  unsigned int batchId() const;
512  int frameNum() const;
514  unsigned int sourceId() const;
516  unsigned int sourceWidth() const;
518  unsigned int sourceHeight() const;
519 
521  unsigned int pipelineWidth() const;
523  unsigned int pipelineHeight() const;
524 
526  uint64_t bufferPTS() const;
528  uint64_t ntpTimestamp() const;
529 
531  void append(const DisplayMetadata&);
533  void append(const UserMetadata&);
535  void append(const ObjectMetadata&);
536 
537  friend class BatchMetadata;
538 };
539 
546 class AudioFrameMetadata : public Metadata {
547  public:
548  typedef std::unique_ptr<AbstractIterator<AudioFrameMetadata>> Iterator;
549 
556  AudioFrameMetadata(void* data=nullptr);
558  virtual ~AudioFrameMetadata();
559 
561  unsigned int iterate(const std::function<void(const ClassifierMetadata&)>& func) const;
564 
566  unsigned int iterate(const std::function<void(const UserMetadata&)>& func, int meta_type) const;
568  void initiateIterator(UserMetadata::Iterator&, int meta_type) const;
569 
571  void append(const UserMetadata&);
572 
574  unsigned int padIndex() const;
576  unsigned int batchId() const;
578  int frameNum() const;
580  unsigned int sourceId() const;
582  int numSamplesPerFrame() const;
584  unsigned int sampleRate() const;
586  unsigned int numChannels() const;
588  int format() const;
590  int layout() const;
592  uint64_t bufferPTS() const;
594  uint64_t ntpTimestamp() const;
596  bool inferDone() const;
598  int classId() const;
600  float confidence() const;
602  std::string classLabel() const;
603 
604  friend class BatchMetadata;
605 };
606 
613  public:
614  PreprocessTensorMetadata(void* data=nullptr);
615  virtual ~PreprocessTensorMetadata();
616 
618  std::string getName() const;
619 
621  unsigned int getMetaId() const;
622 
624  Tensor* getTensor() const;
625 
626  operator bool() const {
627  return data_ != nullptr;
628  }
629 
630  protected:
631  void * data_;
632 };
633 
634 
640 class PreprocessBatchUserMetadata : public UserMetadata {
641  public:
642  PreprocessBatchUserMetadata(void* data=nullptr);
645 
647  std::vector<unsigned int> getTargetUniqueIds() const;
648 
650  std::vector<RoiMetadata> getRois() const;
651 
653  PreprocessTensorMetadata getPreprocessTensorMetadata() const;
654 
656  bool initPreprocessTensorMetadata(const std::string& name, unsigned int meta_id, unsigned int unique_id, Tensor* tensor);
657 };
658 
659 class ObjectVisibilityUserMetadata : public UserMetadata {
660  public:
661  ObjectVisibilityUserMetadata(void* data=nullptr);
662  ObjectVisibilityUserMetadata(const UserMetadata& user_meta);
664 
666  float getVisibility() const;
667 };
668 
669 class ObjectImageFootLocationUserMetadata : public UserMetadata {
670  public:
674 
676  std::pair<float, float> getImageFootLocation() const;
677 };
678 
679 class ObjectWorldFootLocationUserMetadata : public UserMetadata {
680  public:
684 
686  std::pair<float, float> getWorldFootLocation() const;
687 };
688 
689 class ObjectConvexHullUserMetadata : public UserMetadata {
690  public:
691  ObjectConvexHullUserMetadata(void* data=nullptr);
692  ObjectConvexHullUserMetadata(const UserMetadata& user_meta);
694 
696  std::vector<std::pair<int, int>> getConvexHull() const;
697 };
698 
699 class Object3DBBoxUserMetadata : public UserMetadata {
700  public:
701  Object3DBBoxUserMetadata(void* data=nullptr);
702  Object3DBBoxUserMetadata(const UserMetadata& user_meta);
703  virtual ~Object3DBBoxUserMetadata();
704  NvDsObj3DBbox* get3DBbox() const;
705 };
706 
707 class TrackerPastFrameUserMetadata : public UserMetadata {
708  public:
709  TrackerPastFrameUserMetadata(void* data=nullptr);
710  TrackerPastFrameUserMetadata(const UserMetadata& user_meta);
713 };
714 
715 class StructureUserMetadata: public UserMetadata {
716 public:
717  StructureUserMetadata(void* data=nullptr);
718  StructureUserMetadata(const UserMetadata& user_meta);
719  virtual ~StructureUserMetadata();
720  void* getStructureUserMetadata() const;
721  int getStructureUserMetatype() const;
722 };
723 
730 class ObjectReidUserMetadata : public UserMetadata {
731  public:
732  ObjectReidUserMetadata(void* data=nullptr);
733  ObjectReidUserMetadata(const UserMetadata& user_meta);
736  virtual ~ObjectReidUserMetadata();
737 
739  unsigned int featureSize() const;
740 
742  const float* featureVector() const;
743 
753  void setFeatureVector(const float* features, unsigned int size);
754 };
755 
756 class AnalyticsObjInfo: public UserMetadata {
757 public:
763  AnalyticsObjInfo(void* data=nullptr);
764 
766  AnalyticsObjInfo(const UserMetadata& user_meta);
767 
769  virtual ~AnalyticsObjInfo();
770 
772  std::vector<std::string> getRoiStatus() const;
773 
775  std::vector<std::string> getOcStatus() const;
776 
778  std::vector<std::string> getLcStatus() const;
779 
781  std::string getDirStatus() const;
782 
784  unsigned int getUniqueId() const;
785 
787  std::string getObjStatus() const;
788 };
789 
790 class AnalyticsFrameMeta: public UserMetadata {
791 public:
797  AnalyticsFrameMeta(void* data=nullptr);
798 
800  AnalyticsFrameMeta(const UserMetadata& user_meta);
801  virtual ~AnalyticsFrameMeta();
802 
806  std::unordered_map<std::string, bool> getOcStatus() const;
807 
811  std::unordered_map<std::string, uint32_t> getObjInROIcnt() const;
812 
816  std::unordered_map<std::string, uint64_t> getObjLCCurrCnt() const;
817 
821  std::unordered_map<std::string, uint64_t> getObjLCCumCnt() const;
822 
824  unsigned int getUniqueId() const;
825 
829  std::unordered_map<int, uint32_t> getObjCnt() const;
830 };
831 
841 class BatchMetadata : public Metadata {
842  public:
849  BatchMetadata(void *data = nullptr);
850 
852  virtual ~BatchMetadata();
853 
855  unsigned int iterate(const std::function<void(const FrameMetadata&)>& func) const;
858 
860  unsigned int iterate(const std::function<void(const AudioFrameMetadata&)>& func) const;
863 
865  unsigned int iterate(const std::function<void(const UserMetadata&)>& func, int meta_type) const;
867  void initiateIterator(UserMetadata::Iterator&, int meta_type) const;
868 
870  bool acquire(DisplayMetadata&);
872  bool acquire(FrameMetadata&);
874  bool acquire(ObjectMetadata&);
876  bool acquire(EventMessageUserMetadata&);
878  bool acquire(PreprocessBatchUserMetadata&);
880  bool acquire(UserMetadata&);
882  bool acquire(ObjectReidUserMetadata&);
884  template<class C, int N>
886  user_meta = acquireUserMetadata_(
888  );
889  return user_meta ? true : false;
890  }
891 
893  void append(const FrameMetadata&);
895  void append(const UserMetadata&);
896 
898  unsigned int nFrames() const;
900  bool isAudioBatch() const;
901 
902  protected:
904  void* data, unsigned int type, void*(*copy)(void*, void*), void(*free)(void*, void*)
905  );
906 };
907 
908 
909 }
910 
911 #endif
deepstream::AbstractIterator::done
virtual bool done()=0
check if the end is reached
_NvOSD_LineParams
Holds the box parameters of a line to be overlayed.
Definition: includes/nvll_osd_struct.h:188
deepstream::StructureUserMetadata::StructureUserMetadata
StructureUserMetadata(void *data=nullptr)
deepstream::AudioFrameMetadata::numChannels
unsigned int numChannels() const
Audio channel count.
deepstream::EventMessageUserMetadata::EventMessageUserMetadata
EventMessageUserMetadata(void *data=nullptr)
deepstream::AudioFrameMetadata::frameNum
int frameNum() const
Frame number.
deepstream::ObjectReidUserMetadata::setFeatureVector
void setFeatureVector(const float *features, unsigned int size)
Set the ReID feature vector.
deepstream::PreprocessBatchUserMetadata::getTargetUniqueIds
std::vector< unsigned int > getTargetUniqueIds() const
@Brief Get the target unique ids
deepstream::ClassifierMetadata
Meta generated from a classifier.
Definition: service-maker/includes/metadata.hpp:173
_NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Definition: includes/nvll_osd_struct.h:145
deepstream::ObjectMetadata::iterate
unsigned int iterate(const std::function< void(const ClassifierMetadata &)> &func) const
Iterate the classifier metadata within it.
deepstream::AnalyticsFrameMeta::getObjLCCumCnt
std::unordered_map< std::string, uint64_t > getObjLCCumCnt() const
Map of total cumulative count of Line crossing for configured lines, which can be accessed using key,...
_NvOSD_MaskParams
Holds the mask parameters of the segment to be overlayed.
Definition: includes/nvll_osd_struct.h:177
deepstream::ObjectImageFootLocationUserMetadata::~ObjectImageFootLocationUserMetadata
virtual ~ObjectImageFootLocationUserMetadata()
deepstream::AnalyticsObjInfo::~AnalyticsObjInfo
virtual ~AnalyticsObjInfo()
Destructor for AnalyticsObjInfo.
deepstream::ObjectMetadata::Iterator
std::unique_ptr< AbstractIterator< ObjectMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:208
deepstream::ObjectVisibilityUserMetadata::getVisibility
float getVisibility() const
Get the visibility of the object.
deepstream::RoiMetadata::frameMetadata
FrameMetadata frameMetadata() const
Get the frame metadata.
deepstream::AnalyticsFrameMeta::getObjCnt
std::unordered_map< int, uint32_t > getObjCnt() const
Map of total count of objects for each class ID, which can be accessed using key, value pair; where k...
deepstream::ObjectWorldFootLocationUserMetadata::~ObjectWorldFootLocationUserMetadata
virtual ~ObjectWorldFootLocationUserMetadata()
deepstream::AbstractIterator
metadata iterator template
Definition: service-maker/includes/metadata.hpp:71
deepstream::ObjectMetadata::objectId
unsigned long int objectId() const
Number to identify the object which is tracked in the scene.
deepstream::BatchMetadata::acquire
bool acquire(UserMetadataTemplate< C, N > &user_meta)
Initialize an empty user metadata through template.
Definition: 9.2/service-maker/includes/metadata.hpp:885
deepstream::SegmentationUserMetadata::~SegmentationUserMetadata
virtual ~SegmentationUserMetadata()
Destructor for SegmentationUserMetadata.
deepstream::UserMetadata::metaType
int metaType() const
Get the meta type.
deepstream::UserMetadataTemplate::UserMetadataTemplate
UserMetadataTemplate(void *data=nullptr)
Definition: 9.2/service-maker/includes/metadata.hpp:398
deepstream::ObjectReidUserMetadata::~ObjectReidUserMetadata
virtual ~ObjectReidUserMetadata()
deepstream::AudioFrameMetadata::AudioFrameMetadata
AudioFrameMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::AbstractIterator::data_
T data_
Definition: service-maker/includes/metadata.hpp:106
deepstream::ObjectWorldFootLocationUserMetadata::getWorldFootLocation
std::pair< float, float > getWorldFootLocation() const
Get the estimated foot location of the object on the world ground plane.
deepstream::ObjectMetadata::append
void append(const UserMetadata &)
Append user metadata to the object.
deepstream::UserMetadata::setUserData
void setUserData(void *data, void *(*copy)(void *, void *), void(*release)(void *, void *))
Set user data with copy and release functions.
deepstream::AnalyticsFrameMeta::AnalyticsFrameMeta
AnalyticsFrameMeta(void *data=nullptr)
Constructor for AnalyticsFrameMeta.
deepstream::AnalyticsFrameMeta::~AnalyticsFrameMeta
virtual ~AnalyticsFrameMeta()
deepstream::UserMetadata::UserMetadata
UserMetadata(void *)
Constructor through opaque data pointer.
deepstream::ObjectReidUserMetadata::ObjectReidUserMetadata
ObjectReidUserMetadata(void *data=nullptr)
deepstream::AnalyticsObjInfo::getRoiStatus
std::vector< std::string > getRoiStatus() const
Get the ROI status.
deepstream::DisplayMetadata::nRects
unsigned int nRects() const
Number of the rectangles.
deepstream::AbstractIterator::operator->
T * operator->()
Dereference the associated metadata as a pointer.
Definition: 9.2/service-maker/includes/metadata.hpp:83
_NvOSD_CircleParams
Holds circle parameters to be overlayed.
Definition: includes/nvll_osd_struct.h:231
deepstream::PreprocessTensorMetadata
Metadata for preprocessed tensor.
Definition: service-maker/includes/metadata.hpp:612
deepstream::TrackerPastFrameUserMetadata::TrackerPastFrameUserMetadata
TrackerPastFrameUserMetadata(void *data=nullptr)
deepstream::FrameMetadata::pipelineWidth
unsigned int pipelineWidth() const
Picture width of the pipeline.
deepstream::ObjectMetadata::setLabel
void setLabel(std::string)
deepstream::ObjectMetadata::setObjectId
void setObjectId(unsigned long)
deepstream::ObjectMetadata::maskParams
NvOSD_MaskParams & maskParams() const
Holds mask parameters for the object.
deepstream::RoiMetadata::initiateIterator
void initiateIterator(UserMetadata::Iterator &, int meta_type) const
Get the iterator for user metadata within it.
deepstream::AudioFrameMetadata::initiateIterator
void initiateIterator(ClassifierMetadata::Iterator &) const
Get the iterator for classifier metadata within it.
deepstream::DisplayMetadata::~DisplayMetadata
virtual ~DisplayMetadata()
Destructor.
deepstream::ObjectWorldFootLocationUserMetadata::ObjectWorldFootLocationUserMetadata
ObjectWorldFootLocationUserMetadata(void *data=nullptr)
deepstream::ObjectMetadata::classId
unsigned int classId() const
Number to identify the class of the object.
deepstream::UserMetadataTemplate::get
C & get()
Definition: 9.2/service-maker/includes/metadata.hpp:403
deepstream::ObjectMetadata::textParams
NvOSD_TextParams & textParams() const
Formated text description of the object, controlling osd display.
deepstream::AudioFrameMetadata::bufferPTS
uint64_t bufferPTS() const
Holds the presentation timestamp (PTS) of the frame.
deepstream::FrameMetadata::sourceId
unsigned int sourceId() const
Identify the source of the frame, e.g.
deepstream::UserMetadata::~UserMetadata
virtual ~UserMetadata()
Destructor.
deepstream::TensorOutputUserMetadata::~TensorOutputUserMetadata
virtual ~TensorOutputUserMetadata()
deepstream::AudioFrameMetadata::padIndex
unsigned int padIndex() const
Index of the pad from which the audio frame is generated.
deepstream::DisplayMetadata::nLabels
unsigned int nLabels() const
Number of the labels.
deepstream::TensorOutputUserMetadata::TensorOutputUserMetadata
TensorOutputUserMetadata(void *data=nullptr)
deepstream::DisplayMetadata::nCircles
unsigned int nCircles() const
Number of the circles.
deepstream::BatchMetadata::acquireUserMetadata_
UserMetadata acquireUserMetadata_(void *data, unsigned int type, void *(*copy)(void *, void *), void(*free)(void *, void *))
deepstream::ObjectMetadata::~ObjectMetadata
virtual ~ObjectMetadata()
Destructor.
deepstream::AudioFrameMetadata::numSamplesPerFrame
int numSamplesPerFrame() const
Number of samples in the audio frame.
deepstream::ObjectMetadata::uniqueComponentId
unsigned int uniqueComponentId() const
Number to identify the unique component that generates the metadata.
deepstream::AudioFrameMetadata::format
int format() const
Audio sample format.
deepstream::AnalyticsObjInfo::AnalyticsObjInfo
AnalyticsObjInfo(void *data=nullptr)
Constructor for AnalyticsObjInfo.
deepstream::TrackerPastFrameUserMetadata::~TrackerPastFrameUserMetadata
virtual ~TrackerPastFrameUserMetadata()
deepstream::EventMessageUserMetadata::~EventMessageUserMetadata
virtual ~EventMessageUserMetadata()
deepstream::AnalyticsFrameMeta::getObjLCCurrCnt
std::unordered_map< std::string, uint64_t > getObjLCCurrCnt() const
Map of total count of Line crossing in current frame for configured lines, which can be accessed usin...
deepstream::PreprocessTensorMetadata::PreprocessTensorMetadata
PreprocessTensorMetadata(void *data=nullptr)
deepstream::ObjectReidUserMetadata::featureVector
const float * featureVector() const
Get the ReID feature vector (CPU pointer)
deepstream::AbstractIterator::operator!=
bool operator!=(const AbstractIterator< T > &other) const
check if two iterator point to different position
Definition: 9.2/service-maker/includes/metadata.hpp:100
deepstream::BatchMetadata::iterate
unsigned int iterate(const std::function< void(const FrameMetadata &)> &func) const
Iterate the frame metadata within it.
deepstream::ObjectMetadata::nvBboxInfo
NvBbox_Coords & nvBboxInfo() const
Bounding box of the object.
deepstream::StructureUserMetadata::~StructureUserMetadata
virtual ~StructureUserMetadata()
deepstream::ObjectMetadata::initiateIterator
void initiateIterator(ClassifierMetadata::Iterator &) const
Get the iterator for object metadata within it.
deepstream::AudioFrameMetadata::inferDone
bool inferDone() const
Whether inference was performed on the audio frame.
deepstream::ObjectImageFootLocationUserMetadata::ObjectImageFootLocationUserMetadata
ObjectImageFootLocationUserMetadata(void *data=nullptr)
deepstream::FrameMetadata::initiateIterator
void initiateIterator(ObjectMetadata::Iterator &) const
Get the iterator for object metadata within it.
_NvOSD_ArrowParams
Holds arrow parameters to be overlaid.
Definition: includes/nvll_osd_struct.h:207
deepstream::DisplayMetadata::Iterator
std::unique_ptr< AbstractIterator< DisplayMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:435
deepstream::ObjectConvexHullUserMetadata::~ObjectConvexHullUserMetadata
virtual ~ObjectConvexHullUserMetadata()
deepstream::LabelInfo
Holds all fields of a single label entry from a classifier.
Definition: service-maker/includes/metadata.hpp:153
deepstream::LabelInfo::LabelInfo
LabelInfo(void *data)
deepstream::FrameMetadata::sourceWidth
unsigned int sourceWidth() const
Picture width of the source.
deepstream::PreprocessTensorMetadata::getTensor
Tensor * getTensor() const
Get the tensor.
deepstream::DisplayMetadata::nArrows
unsigned int nArrows() const
Number of the arrows.
deepstream::EventMessageUserMetadata
User metadata for event message.
Definition: service-maker/includes/metadata.hpp:277
deepstream::ObjectReidUserMetadata::featureSize
unsigned int featureSize() const
Get the ReID feature vector size.
deepstream::Metadata
Metadata base class.
Definition: service-maker/includes/metadata.hpp:48
deepstream::AnalyticsObjInfo::getObjStatus
std::string getObjStatus() const
Get the object status.
deepstream::AudioFrameMetadata::sampleRate
unsigned int sampleRate() const
Audio sample rate.
deepstream::PreprocessBatchUserMetadata::getPreprocessTensorMetadata
PreprocessTensorMetadata getPreprocessTensorMetadata() const
Get the preprocess tensor metadata.
deepstream::PreprocessBatchUserMetadata::initPreprocessTensorMetadata
bool initPreprocessTensorMetadata(const std::string &name, unsigned int meta_id, unsigned int unique_id, Tensor *tensor)
Initialize a preprocess tensor metadata.
deepstream::LabelInfo::label
std::string label() const
The label string of the result.
deepstream::UserMetadataTemplate
Template for customized user metadata.
Definition: service-maker/includes/metadata.hpp:396
deepstream::ObjectMetadata::setRectParams
void setRectParams(const NvOSD_RectParams &)
deepstream::FrameMetadata::FrameMetadata
FrameMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::FrameMetadata::append
void append(const DisplayMetadata &)
Append display metadata to the frame.
deepstream::AbstractIterator::~AbstractIterator
virtual ~AbstractIterator()
Destructor.
Definition: 9.2/service-maker/includes/metadata.hpp:77
deepstream::AudioFrameMetadata::layout
int layout() const
Audio channel layout.
deepstream::UserMetadata::setMetaType
void setMetaType(int type)
Set the meta type.
deepstream::ObjectMetadata
Object metadata.
Definition: service-maker/includes/metadata.hpp:206
deepstream::TensorOutputUserMetadata::getLayers
std::unordered_map< std::string, Tensor * > getLayers()
get tensor output layers
deepstream::AnalyticsFrameMeta::getObjInROIcnt
std::unordered_map< std::string, uint32_t > getObjInROIcnt() const
Map of total count of valid objects in ROI for configured ROIs, which can be accessed using key,...
deepstream::ClassifierMetadata::~ClassifierMetadata
virtual ~ClassifierMetadata()
Destructor.
deepstream::RoiMetadata::objectMetadata
ObjectMetadata objectMetadata() const
Get the object metadata.
deepstream::RoiMetadata::iterate
unsigned int iterate(const std::function< void(const UserMetadata &)> &func, int meta_type) const
Iterate the user metadata within it.
deepstream::SegmentationUserMetadata::getClassProbabilitiesMap
const float * getClassProbabilitiesMap() const
Get the class probabilities map for the segmentation.
deepstream::UserMetadata::userData
void * userData() const
Get the user data pointer.
deepstream
Definition: service-maker/includes/buffer.hpp:38
deepstream::StructureUserMetadata::getStructureUserMetadata
void * getStructureUserMetadata() const
deepstream::PreprocessBatchUserMetadata::~PreprocessBatchUserMetadata
virtual ~PreprocessBatchUserMetadata()
deepstream::ClassifierMetadata::nLabels
unsigned int nLabels() const
Number of the lables generated by the classifier.
deepstream::PreprocessBatchUserMetadata::PreprocessBatchUserMetadata
PreprocessBatchUserMetadata(void *data=nullptr)
deepstream::AudioFrameMetadata::classId
int classId() const
Class id of the last classified event.
deepstream::Metadata::~Metadata
virtual ~Metadata()
Destructor.
deepstream::ObjectMetadata::setUniqueComponentId
void setUniqueComponentId(unsigned int)
deepstream::AudioFrameMetadata::Iterator
std::unique_ptr< AbstractIterator< AudioFrameMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:548
deepstream::BatchMetadata::initiateIterator
void initiateIterator(FrameMetadata::Iterator &) const
Get the iterator for frame metadata within it.
deepstream::AbstractIterator::operator==
bool operator==(const AbstractIterator< T > &other) const
check if two iterator point to the same position
Definition: 9.2/service-maker/includes/metadata.hpp:95
deepstream::FrameMetadata::padIndex
unsigned int padIndex() const
Index of the pad from which the frame is generated.
deepstream::SegmentationUserMetadata::getClassMap
const int * getClassMap() const
Get the class map for the segmentation.
deepstream::DisplayMetadata::DisplayMetadata
DisplayMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::BatchMetadata
Holds information about a formed batch containingframes from different sources.
Definition: service-maker/includes/metadata.hpp:841
deepstream::FrameMetadata::~FrameMetadata
virtual ~FrameMetadata()
Destructor.
deepstream::AudioFrameMetadata::confidence
float confidence() const
Confidence of the last classified event.
deepstream::Metadata::Metadata
Metadata(void *data)
Constructor through an opqaue pinter.
deepstream::ObjectReidUserMetadata::operator=
ObjectReidUserMetadata & operator=(const ObjectReidUserMetadata &)
Copy assignment operator.
deepstream::AbstractIterator::operator*
T & operator*()
Dereference the associated metadata.
Definition: 9.2/service-maker/includes/metadata.hpp:80
deepstream::AudioFrameMetadata::append
void append(const UserMetadata &)
Append user metadata to the audio frame.
deepstream::PreprocessTensorMetadata::getName
std::string getName() const
Get the name of the tensor.
pydeepstreamdoc::tensor::TensorDoc::size
constexpr const char * size
Definition: service-maker/sources/python/src/bindings/docstrings/tensordoc.h:46
deepstream::ObjectVisibilityUserMetadata::ObjectVisibilityUserMetadata
ObjectVisibilityUserMetadata(void *data=nullptr)
Tensor
Structure to store tensor information.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/utils/tensor.h:40
deepstream::BatchMetadata::~BatchMetadata
virtual ~BatchMetadata()
Destructor.
deepstream::ObjectMetadata::ObjectMetadata
ObjectMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::AnalyticsObjInfo::getUniqueId
unsigned int getUniqueId() const
Get the unique identifier for this metadata.
deepstream::FrameMetadata::Iterator
std::unique_ptr< AbstractIterator< FrameMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:480
deepstream::AnalyticsObjInfo::getDirStatus
std::string getDirStatus() const
Get the direction status.
deepstream::UserMetadata
Base class of user defined metadata.
Definition: service-maker/includes/metadata.hpp:110
deepstream::FrameMetadata::batchId
unsigned int batchId() const
Location the frame in the batch.
deepstream::AudioFrameMetadata::batchId
unsigned int batchId() const
Location the audio frame in the batch.
deepstream::BatchMetadata::append
void append(const FrameMetadata &)
Append a frame metadata to the batch.
deepstream::UserMetadataTemplate::copy
static void * copy(void *data, void *user_data)
Definition: 9.2/service-maker/includes/metadata.hpp:409
deepstream::AbstractIterator::AbstractIterator
AbstractIterator(const T &data)
Construct an iterator for an iterable metadata.
Definition: 9.2/service-maker/includes/metadata.hpp:74
deepstream::DisplayMetadata
Metadata for overlay display on a frame.
Definition: service-maker/includes/metadata.hpp:433
deepstream::UserMetadataTemplate::~UserMetadataTemplate
virtual ~UserMetadataTemplate()
Definition: 9.2/service-maker/includes/metadata.hpp:400
deepstream::RoiMetadata::RoiMetadata
RoiMetadata(void *data=nullptr)
deepstream::Metadata::data_
void * data_
Definition: service-maker/includes/metadata.hpp:60
deepstream::ObjectVisibilityUserMetadata::~ObjectVisibilityUserMetadata
virtual ~ObjectVisibilityUserMetadata()
deepstream::FrameMetadata::ntpTimestamp
uint64_t ntpTimestamp() const
Holds the ntp timestamp.
deepstream::ObjectMetadata::setTextParams
void setTextParams(const NvOSD_TextParams &)
deepstream::AudioFrameMetadata::ntpTimestamp
uint64_t ntpTimestamp() const
Holds the ntp timestamp.
deepstream::ObjectConvexHullUserMetadata::ObjectConvexHullUserMetadata
ObjectConvexHullUserMetadata(void *data=nullptr)
deepstream::LabelInfo::prob
float prob() const
Probability of the best result.
deepstream::SegmentationUserMetadata::SegmentationUserMetadata
SegmentationUserMetadata(void *data=nullptr)
Constructor for SegmentationUserMetadata.
deepstream::ObjectMetadata::label
std::string label() const
A string to describe the object class.
deepstream::ClassifierMetadata::uniqueComponentId
unsigned int uniqueComponentId() const
Identifying the unique component that generates the metadata.
deepstream::UserMetadataTemplate::UserMetadataTemplate
UserMetadataTemplate(const UserMetadata &other)
Definition: 9.2/service-maker/includes/metadata.hpp:399
deepstream::LabelInfo::labelId
unsigned int labelId() const
Label ID for multi-label classifiers.
deepstream::ObjectMetadata::setNvBboxInfo
void setNvBboxInfo(const NvBbox_Coords &)
deepstream::PreprocessTensorMetadata::getMetaId
unsigned int getMetaId() const
Get the meta id of the tensor.
deepstream::ObjectImageFootLocationUserMetadata::getImageFootLocation
std::pair< float, float > getImageFootLocation() const
Get the image foot location of the object.
deepstream::SegmentationUserMetadata::getClasses
unsigned int getClasses() const
Get the number of classes in the segmentation.
deepstream::PreprocessTensorMetadata::data_
void * data_
Definition: service-maker/includes/metadata.hpp:631
_NvOSD_TextParams
Holds parameters of text to be overlayed.
Definition: includes/nvll_osd_struct.h:120
deepstream::FrameMetadata::frameNum
int frameNum() const
Frame number.
deepstream::StructureUserMetadata::getStructureUserMetatype
int getStructureUserMetatype() const
deepstream::AudioFrameMetadata::classLabel
std::string classLabel() const
Label of the last classified event.
deepstream::ClassifierMetadata::classifierType
std::string classifierType() const
Type of the classifier.
deepstream::FrameMetadata::bufferPTS
uint64_t bufferPTS() const
Holds the presentation timestamp (PTS) of the frame.
deepstream::BatchMetadata::nFrames
unsigned int nFrames() const
Number of frames in the batch.
deepstream::Tensor
Definition: service-maker/includes/tensor.hpp:43
deepstream::AudioFrameMetadata
Holds information for a single audio frame.
Definition: service-maker/includes/metadata.hpp:546
deepstream::AnalyticsObjInfo::getLcStatus
std::vector< std::string > getLcStatus() const
Get the line crossing status.
deepstream::LabelInfo::classId
unsigned int classId() const
Class ID of the best result.
deepstream::RoiMetadata::~RoiMetadata
virtual ~RoiMetadata()
deepstream::AnalyticsFrameMeta::getUniqueId
unsigned int getUniqueId() const
Get the unique identifier for this metadata.
deepstream::SegmentationUserMetadata::uniqueId
unsigned int uniqueId() const
Get the unique identifier for this metadata.
deepstream::AbstractIterator::equals
virtual bool equals(const AbstractIterator< T > &other) const =0
deepstream::AnalyticsFrameMeta::getOcStatus
std::unordered_map< std::string, bool > getOcStatus() const
Map of boolean status of overcrowding for configured ROIs, which can be accessed using key,...
_NvDsTargetMiscDataBatch
Batch of all streams of a given target misc output.
Definition: includes/nvds_tracker_meta.h:113
deepstream::TrackerPastFrameUserMetadata::getTrackerMiscDataBatch
NvDsTargetMiscDataBatch * getTrackerMiscDataBatch() const
deepstream::Object3DBBoxUserMetadata::get3DBbox
NvDsObj3DBbox * get3DBbox() const
deepstream::ClassifierMetadata::Iterator
std::unique_ptr< AbstractIterator< ClassifierMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:175
deepstream::EventMessageUserMetadata::generate
void generate(const ObjectMetadata &, const FrameMetadata &, const std::string sensor="N/A", const std::string uri="N/A", const std::vector< std::string >labels=std::vector< std::string >())
generate an event by attaching an object
_NvDsObj3DBbox
Holds 3D bbox information for an object.
Definition: includes/nvds_tracker_meta.h:177
deepstream::UserMetadata::get_
void get_(void *&)
deepstream::PreprocessBatchUserMetadata::getRois
std::vector< RoiMetadata > getRois() const
Get the roi list.
deepstream::RoiMetadata::rectParams
NvOSD_RectParams & rectParams() const
Get the region of interest.
deepstream::PreprocessTensorMetadata::~PreprocessTensorMetadata
virtual ~PreprocessTensorMetadata()
deepstream::Object3DBBoxUserMetadata::~Object3DBBoxUserMetadata
virtual ~Object3DBBoxUserMetadata()
deepstream::ObjectMetadata::setClassId
void setClassId(unsigned int)
deepstream::ClassifierMetadata::getLabel
std::string getLabel(unsigned int nth) const
Get the label string of the nth label.
deepstream::UserMetadataTemplate::free
static void free(void *data, void *user_data)
Definition: 9.2/service-maker/includes/metadata.hpp:417
deepstream::ClassifierMetadata::ClassifierMetadata
ClassifierMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::AbstractIterator::get
T & get()
Directly access the associated metadata.
Definition: 9.2/service-maker/includes/metadata.hpp:86
deepstream::FrameMetadata::pipelineHeight
unsigned int pipelineHeight() const
Picture height of the pipeline.
data
JSAMPIMAGE data
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:967
deepstream::AudioFrameMetadata::sourceId
unsigned int sourceId() const
Identify the source of the frame, e.g.
deepstream::AudioFrameMetadata::~AudioFrameMetadata
virtual ~AudioFrameMetadata()
Destructor.
deepstream::ObjectMetadata::trackerConfidence
float trackerConfidence() const
Confidence level from tracker.
deepstream::LabelInfo::numClasses
unsigned int numClasses() const
Number of classes for this label.
deepstream::FrameMetadata::iterate
unsigned int iterate(const std::function< void(const ObjectMetadata &)> &func) const
Iterate the object metadata within it.
deepstream::DisplayMetadata::nLines
unsigned int nLines() const
Number of the lines.
deepstream::SegmentationUserMetadata::getWidth
unsigned int getWidth() const
Get the width of the segmentation map.
deepstream::ClassifierMetadata::getLabelInfo
LabelInfo getLabelInfo(unsigned int nth) const
Get all fields of the nth label.
deepstream::SegmentationUserMetadata::getHeight
unsigned int getHeight() const
Get the height of the segmentation map.
deepstream::BatchMetadata::acquire
bool acquire(DisplayMetadata &)
Initialize an empty display metadata.
deepstream::TensorOutputUserMetadata::uniqueId
unsigned int uniqueId() const
id for inference instance
deepstream::Object3DBBoxUserMetadata::Object3DBBoxUserMetadata
Object3DBBoxUserMetadata(void *data=nullptr)
deepstream::ObjectMetadata::confidence
float confidence() const
Confidence level.
deepstream::ObjectMetadata::rectParams
NvOSD_RectParams & rectParams() const
Bounding box of the object.
deepstream::BatchMetadata::isAudioBatch
bool isAudioBatch() const
Whether the batch contains NvDsAudioFrameMeta entries.
_NvBbox_Coords
Holds unclipped bounding box coordinates of the object.
Definition: includes/nvll_osd_struct.h:71
deepstream::ObjectMetadata::setConfidence
void setConfidence(float)
deepstream::ObjectConvexHullUserMetadata::getConvexHull
std::vector< std::pair< int, int > > getConvexHull() const
Get the convex hull points (x, y) of the object, estimated from the 3D cylinder model.
deepstream::AbstractIterator::next
virtual AbstractIterator< T > & next()=0
advances the iterator to access the next data
deepstream::AnalyticsObjInfo::getOcStatus
std::vector< std::string > getOcStatus() const
Get the overcrowding status.
deepstream::ObjectMetadata::setTrackerConfidence
void setTrackerConfidence(float)
deepstream::FrameMetadata
Holds information for a single frame.
Definition: service-maker/includes/metadata.hpp:478
deepstream::AudioFrameMetadata::iterate
unsigned int iterate(const std::function< void(const ClassifierMetadata &)> &func) const
Iterate the classifier metadata within it.
deepstream::FrameMetadata::sourceHeight
unsigned int sourceHeight() const
Picture height of the source.
deepstream::UserMetadata::Iterator
std::unique_ptr< AbstractIterator< UserMetadata > > Iterator
Definition: 9.2/service-maker/includes/metadata.hpp:112
deepstream::ObjectMetadata::setMaskParams
void setMaskParams(const NvOSD_MaskParams &)
deepstream::BatchMetadata::BatchMetadata
BatchMetadata(void *data=nullptr)
Constructor through opaque data pointer.
deepstream::DisplayMetadata::add
bool add(NvOSD_TextParams &)
Add a text label.