-
Notifications
You must be signed in to change notification settings - Fork 497
/
Copy pathtrackermetadoc.h
150 lines (127 loc) · 8.41 KB
/
trackermetadoc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
* SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
namespace pydsdoc
{
namespace trackerdoc
{
namespace NvDsTargetMiscDataFrameDoc //missing doxygen comments
{
constexpr const char* descr = R"pyds(
NvDsTargetMiscDataFrame
:ivar frameNum: *int*, frameNum
:ivar tBbox: :class:`NvOSD_RectParams`, tBbox
:ivar confidence: *float*, confidence
:ivar age: *int*, age
Example usage:
::
l_user=batch_meta.batch_user_meta_list #Retrieve glist of NvDsUserMeta objects from given NvDsBatchMeta object
while l_user is not None:
try:
# Note that l_user.data needs a cast to pyds.NvDsUserMeta
# The casting is done by pyds.NvDsUserMeta.cast()
# The casting also keeps ownership of the underlying memory
# in the C code, so the Python garbage collector will leave
# it alone
user_meta=pyds.NvDsUserMeta.cast(l_user.data)
except StopIteration:
break
if(user_meta and user_meta.base_meta.meta_type==pyds.NvDsMetaType.NVDS_TRACKER_PAST_FRAME_META): #Make sure metatype is correct
try:
# Note that user_meta.user_meta_data needs a cast to pyds.NvDsTargetMiscDataBatch
# The casting is done by pyds.NvDsTargetMiscDataBatch.cast()
# The casting also keeps ownership of the underlying memory
# in the C code, so the Python garbage collector will leave
# it alone
pPastFrameObjBatch = pyds.NvDsTargetMiscDataBatch.cast(user_meta.user_meta_data) #See NvDsTargetMiscDataBatch for details
except StopIteration:
break
for trackobj in pyds.NvDsTargetMiscDataBatch.list(pPastFrameObjBatch): #Iterate through list of NvDsTargetMiscDataStream objects
#Access NvDsTargetMiscDataStream attributes
print("streamId=",trackobj.streamID)
print("surfaceStreamID=",trackobj.surfaceStreamID)
for pastframeobj in pyds.NvDsTargetMiscDataStream.list(trackobj): #Iterate through list of NvDsFrameObjList objects
#Access NvDsTargetMiscDataObject attributes
print("numobj=",pastframeobj.numObj)
print("uniqueId=",pastframeobj.uniqueId)
print("classId=",pastframeobj.classId)
print("objLabel=",pastframeobj.objLabel)
for objlist in pyds.NvDsTargetMiscDataObject.list(pastframeobj): #Iterate through list of NvDsFrameObj objects
#Access NvDsTargetMiscDataFrame attributes
print('frameNum:', objlist.frameNum)
print('tBbox.left:', objlist.tBbox.left)
print('tBbox.width:', objlist.tBbox.width)
print('tBbox.top:', objlist.tBbox.top)
print('tBbox.right:', objlist.tBbox.height)
print('confidence:', objlist.confidence)
print('age:', objlist.age)
try:
l_user=l_user.next
except StopIteration:
break)pyds";
constexpr const char* cast=R"pyds(cast given object/data to :class:`NvDsTargetMiscDataFrame`, call pyds.NvDsTargetMiscDataFrame.cast(data))pyds";
}
namespace NvDsTargetMiscDataObjectDoc
{
constexpr const char* descr = R"pyds(
One object in several past frames. See :class:`NvDsTargetMiscDataFrame` for example usage.
:ivar numObj: *int*, Number of frames this object appreared in the past.
:ivar uniqueId: *int*, Object tracking id.
:ivar classID: *int*, Object class id.
:ivar objLabel: An array of the string describing the object class.)pyds";
constexpr const char* list=R"pyds(Retrieve :class:`NvDsTargetMiscDataObject` object as list of :class:`NvDsTargetMiscDataFrame`. Contains past frame info of this object.)pyds";
constexpr const char* cast=R"pyds(cast given object/data to :class:`NvDsTargetMiscDataObject`, call pyds.NvDsTargetMiscDataObject.cast(data))pyds";
}
namespace NvDsTargetMiscDataStreamDoc
{
constexpr const char* descr = R"pyds(
List of objects in each stream. See :class:`NvDsTargetMiscDataFrame` for example usage.
:ivar streamID: *int*, Stream id the same as frame_meta->pad_index.
:ivar surfaceStreamID: *int*, Stream id used inside tracker plugin.
:ivar numAllocated: *int*, Maximum number of objects allocated.
:ivar numFilled: *int*, Number of objects in this frame.)pyds";
constexpr const char* list=R"pyds(Retrieve :class:`NvDsTargetMiscDataStream` object as list of :class:`NvDsTargetMiscDataObject`. Contains objects inside this stream.)pyds";
constexpr const char* cast=R"pyds(cast given object/data to :class:`NvDsTargetMiscDataStream`, call pyds.NvDsTargetMiscDataStream.cast(data))pyds";
}
namespace NvDsTargetMiscDataBatchDoc
{
constexpr const char* descr = R"pyds(
Batch of lists of buffered objects. See :class:`NvDsTargetMiscDataFrame` for example usage.
:ivar numAllocated: *int*, Number of blocks allocated for the list.
:ivar numFilled: *int*, Number of filled blocks in the list.
)pyds";
constexpr const char* list=R"pyds(Retrieve :class:`NvDsTargetMiscDataBatch` object as list of :class:`NvDsTargetMiscDataStream`. Contains stream lists.)pyds";
constexpr const char* cast=R"pyds(cast given object/data to :class:`NvDsTargetMiscDataBatch`, call pyds.NvDsTargetMiscDataBatch.cast(data))pyds";
}
namespace NvDsObjReidDoc
{
constexpr const char* descr = R"pyds(
Holds Reid Vector information for an object. See :class:`NvDsObjReid` for example usage.
:ivar featureSize: *int*, ReID vector length.
)pyds";
constexpr const char* get_host_reid_vector =R"pyds(
This function converts the float* ptr_host to a NumPy array (py::array_t<float>).
It constructs a NumPy array with the shape defined by featureSize and the data provided by ptr_host without copying the data. The array uses the float* directly from the C++ struct.
:returns: Returns Host ReID vector as NumPy array)pyds";
constexpr const char* get_dev_reid_vector =R"pyds(
This function converts the float* ptr_dev to a NumPy array (py::array_t<float>).
It constructs a NumPy array with the shape defined by featureSize and the data provided by ptr_dev without copying the data. The array uses the float* directly from the C++ struct.
:returns: Returns Device ReID vector as NumPy array)pyds";
constexpr const char* cast=R"pyds(cast given object/data to :class:`NvDsObjReid`, call pyds.NvDsObjReid.cast(data))pyds";
}
}
}