nvdsmeta_schema.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. /*
  2. * Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * NVIDIA Corporation and its licensors retain all intellectual property
  5. * and proprietary rights in and to this software, related documentation
  6. * and any modifications thereto. Any use, reproduction, disclosure or
  7. * distribution of this software and related documentation without an express
  8. * license agreement from NVIDIA Corporation is strictly prohibited.
  9. *
  10. */
  11. /**
  12. * @file
  13. * <b>NVIDIA DeepStream: Metadata Extension Structures</b>
  14. *
  15. * @b Description: This file defines the NVIDIA DeepStream metadata structures
  16. * used to describe metadata objects.
  17. */
  18. /**
  19. * @defgroup metadata_extensions Metadata Extension Structures
  20. *
  21. * Defines metadata structures used to describe metadata objects.
  22. *
  23. * @ingroup NvDsMetaApi
  24. * @{
  25. */
  26. #ifndef NVDSMETA_H_
  27. #define NVDSMETA_H_
  28. #include <glib.h>
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #endif
  33. /**
  34. * Defines event type flags.
  35. */
  36. typedef enum NvDsEventType {
  37. NVDS_EVENT_ENTRY,
  38. NVDS_EVENT_EXIT,
  39. NVDS_EVENT_MOVING,
  40. NVDS_EVENT_STOPPED,
  41. NVDS_EVENT_EMPTY,
  42. NVDS_EVENT_PARKED,
  43. NVDS_EVENT_RESET,
  44. /** Reserved for future use. Custom events must be assigned values
  45. greater than this. */
  46. NVDS_EVENT_RESERVED = 0x100,
  47. /** Specifies a custom event. */
  48. NVDS_EVENT_CUSTOM = 0x101,
  49. NVDS_EVENT_FORCE32 = 0x7FFFFFFF
  50. } NvDsEventType;
  51. /**
  52. * Defines object type flags.
  53. */
  54. typedef enum NvDsObjectType {
  55. NVDS_OBJECT_TYPE_VEHICLE,
  56. NVDS_OBJECT_TYPE_PERSON,
  57. NVDS_OBJECT_TYPE_FACE,
  58. NVDS_OBJECT_TYPE_BAG,
  59. NVDS_OBJECT_TYPE_BICYCLE,
  60. NVDS_OBJECT_TYPE_ROADSIGN,
  61. NVDS_OBJECT_TYPE_VEHICLE_EXT,
  62. NVDS_OBJECT_TYPE_PERSON_EXT,
  63. NVDS_OBJECT_TYPE_FACE_EXT,
  64. /** Reserved for future use. Custom objects must be assigned values
  65. greater than this. */
  66. NVDS_OBJECT_TYPE_RESERVED = 0x100,
  67. /** Specifies a custom object. */
  68. NVDS_OBJECT_TYPE_CUSTOM = 0x101,
  69. /** "object" key will be missing in the schema */
  70. NVDS_OBJECT_TYPE_UNKNOWN = 0x102,
  71. NVDS_OBEJCT_TYPE_FORCE32 = 0x7FFFFFFF
  72. } NvDsObjectType;
  73. /**
  74. * Defines payload type flags.
  75. */
  76. typedef enum NvDsPayloadType {
  77. NVDS_PAYLOAD_DEEPSTREAM,
  78. NVDS_PAYLOAD_DEEPSTREAM_MINIMAL,
  79. /** Reserved for future use. Custom payloads must be assigned values
  80. greater than this. */
  81. NVDS_PAYLOAD_RESERVED = 0x100,
  82. /** Specifies a custom payload. You must implement the nvds_msg2p_*
  83. interface. */
  84. NVDS_PAYLOAD_CUSTOM = 0x101,
  85. NVDS_PAYLOAD_FORCE32 = 0x7FFFFFFF
  86. } NvDsPayloadType;
  87. /**
  88. * Holds a rectangle's position and size.
  89. */
  90. typedef struct NvDsRect {
  91. float top; /**< Holds the position of rectangle's top in pixels. */
  92. float left; /**< Holds the position of rectangle's left side in pixels. */
  93. float width; /**< Holds the rectangle's width in pixels. */
  94. float height; /**< Holds the rectangle's height in pixels. */
  95. } NvDsRect;
  96. /**
  97. * Holds geolocation parameters.
  98. */
  99. typedef struct NvDsGeoLocation {
  100. gdouble lat; /**< Holds the location's latitude. */
  101. gdouble lon; /**< Holds the location's longitude. */
  102. gdouble alt; /**< Holds the location's altitude. */
  103. } NvDsGeoLocation;
  104. /**
  105. * Hold a coordinate's position.
  106. */
  107. typedef struct NvDsCoordinate {
  108. gdouble x; /**< Holds the coordinate's X position. */
  109. gdouble y; /**< Holds the coordinate's Y position. */
  110. gdouble z; /**< Holds the coordinate's Z position. */
  111. } NvDsCoordinate;
  112. /**
  113. * Holds an object's signature.
  114. */
  115. typedef struct NvDsObjectSignature {
  116. /** Holds a pointer to an array of signature values. */
  117. gdouble *signature;
  118. /** Holds the number of signature values in @a signature. */
  119. guint size;
  120. } NvDsObjectSignature;
  121. /**
  122. * Holds a vehicle object's parameters.
  123. */
  124. typedef struct NvDsVehicleObject {
  125. gchar *type; /**< Holds a pointer to the type of the vehicle. */
  126. gchar *make; /**< Holds a pointer to the make of the vehicle. */
  127. gchar *model; /**< Holds a pointer to the model of the vehicle. */
  128. gchar *color; /**< Holds a pointer to the color of the vehicle. */
  129. gchar *region; /**< Holds a pointer to the region of the vehicle. */
  130. gchar *license; /**< Holds a pointer to the license number of the vehicle.*/
  131. } NvDsVehicleObject;
  132. /**
  133. * Holds a person object's parameters.
  134. */
  135. typedef struct NvDsPersonObject {
  136. gchar *gender; /**< Holds a pointer to the person's gender. */
  137. gchar *hair; /**< Holds a pointer to the person's hair color. */
  138. gchar *cap; /**< Holds a pointer to the type of cap the person is
  139. wearing, if any. */
  140. gchar *apparel; /**< Holds a pointer to a description of the person's
  141. apparel. */
  142. guint age; /**< Holds the person's age. */
  143. } NvDsPersonObject;
  144. /**
  145. * Holds a face object's parameters.
  146. */
  147. typedef struct NvDsFaceObject {
  148. gchar *gender; /**< Holds a pointer to the person's gender. */
  149. gchar *hair; /**< Holds a pointer to the person's hair color. */
  150. gchar *cap; /**< Holds a pointer to the type of cap the person
  151. is wearing, if any. */
  152. gchar *glasses; /**< Holds a pointer to the type of glasses the person
  153. is wearing, if any. */
  154. gchar *facialhair;/**< Holds a pointer to the person's facial hair color. */
  155. gchar *name; /**< Holds a pointer to the person's name. */
  156. gchar *eyecolor; /**< Holds a pointer to the person's eye color. */
  157. guint age; /**< Holds the person's age. */
  158. } NvDsFaceObject;
  159. /**
  160. * Holds a vehicle object's parameters.
  161. */
  162. typedef struct NvDsVehicleObjectExt {
  163. gchar *type; /**< Holds a pointer to the type of the vehicle. */
  164. gchar *make; /**< Holds a pointer to the make of the vehicle. */
  165. gchar *model; /**< Holds a pointer to the model of the vehicle. */
  166. gchar *color; /**< Holds a pointer to the color of the vehicle. */
  167. gchar *region; /**< Holds a pointer to the region of the vehicle. */
  168. gchar *license; /**< Holds a pointer to the license number of the vehicle.*/
  169. GList *mask; /**< Holds a list of polygons for vehicle mask. */
  170. } NvDsVehicleObjectExt;
  171. /**
  172. * Holds a person object's parameters.
  173. */
  174. typedef struct NvDsPersonObjectExt {
  175. gchar *gender; /**< Holds a pointer to the person's gender. */
  176. gchar *hair; /**< Holds a pointer to the person's hair color. */
  177. gchar *cap; /**< Holds a pointer to the type of cap the person is
  178. wearing, if any. */
  179. gchar *apparel; /**< Holds a pointer to a description of the person's
  180. apparel. */
  181. guint age; /**< Holds the person's age. */
  182. GList *mask; /**< Holds a list of polygons for person mask. */
  183. } NvDsPersonObjectExt;
  184. /**
  185. * Holds a face object's parameters.
  186. */
  187. typedef struct NvDsFaceObjectWithExt {
  188. gchar *gender; /**< Holds a pointer to the person's gender. */
  189. gchar *hair; /**< Holds a pointer to the person's hair color. */
  190. gchar *cap; /**< Holds a pointer to the type of cap the person
  191. is wearing, if any. */
  192. gchar *glasses; /**< Holds a pointer to the type of glasses the person
  193. is wearing, if any. */
  194. gchar *facialhair;/**< Holds a pointer to the person's facial hair color. */
  195. gchar *name; /**< Holds a pointer to the person's name. */
  196. gchar *eyecolor; /**< Holds a pointer to the person's eye color. */
  197. guint age; /**< Holds the person's age. */
  198. GList *mask; /**< Holds a list of polygons for face mask. */
  199. } NvDsFaceObjectExt;
  200. /**
  201. * Holds event message meta data.
  202. *
  203. * You can attach various types of objects (vehicle, person, face, etc.)
  204. * to an event by setting a pointer to the object in @a extMsg.
  205. *
  206. * Similarly, you can attach a custom object to an event by setting a pointer to the object in @a extMsg.
  207. * A custom object must be handled by the metadata parsing module accordingly.
  208. */
  209. typedef struct NvDsEventMsgMeta {
  210. /** Holds the event's type. */
  211. NvDsEventType type;
  212. /** Holds the object's type. */
  213. NvDsObjectType objType;
  214. /** Holds the object's bounding box. */
  215. NvDsRect bbox;
  216. /** Holds the object's geolocation. */
  217. NvDsGeoLocation location;
  218. /** Holds the object's coordinates. */
  219. NvDsCoordinate coordinate;
  220. /** Holds the object's signature. */
  221. NvDsObjectSignature objSignature;
  222. /** Holds the object's class ID. */
  223. gint objClassId;
  224. /** Holds the ID of the sensor that generated the event. */
  225. gint sensorId;
  226. /** Holds the ID of the analytics module that generated the event. */
  227. gint moduleId;
  228. /** Holds the ID of the place related to the object. */
  229. gint placeId;
  230. /** Holds the ID of the component (plugin) that generated this event. */
  231. gint componentId;
  232. /** Holds the video frame ID of this event. */
  233. gint frameId;
  234. /** Holds the confidence level of the inference. */
  235. gdouble confidence;
  236. /** Holds the object's tracking ID. */
  237. guint64 trackingId;
  238. /** Holds a pointer to the generated event's timestamp. */
  239. gchar *ts;
  240. /** Holds a pointer to the detected or inferred object's ID. */
  241. gchar *objectId;
  242. /** Holds a pointer to a string containing the sensor's identity. */
  243. gchar *sensorStr;
  244. /** Holds a pointer to a string containing other attributes associated with
  245. the object. */
  246. gchar *otherAttrs;
  247. /** Holds a pointer to the name of the video file. */
  248. gchar *videoPath;
  249. guint occupancy;
  250. guint source_id;
  251. guint lccum_cnt_entry;
  252. guint lccum_cnt_exit;
  253. /** Holds a pointer to event message meta data. This can be used to hold
  254. data that can't be accommodated in the existing fields, or an associated
  255. object (representing a vehicle, person, face, etc.). */
  256. gpointer extMsg;
  257. /** Holds the size of the custom object at @a extMsg. */
  258. guint extMsgSize;
  259. } NvDsEventMsgMeta;
  260. /**
  261. * Holds event information.
  262. */
  263. typedef struct _NvDsEvent {
  264. /** Holds the type of event. */
  265. NvDsEventType eventType;
  266. /** Holds a pointer to event metadata. */
  267. NvDsEventMsgMeta *metadata;
  268. } NvDsEvent;
  269. /**
  270. * Holds data for any user defined custom message to be attached to the payload
  271. * message : custom message to be attached
  272. * size : size of the custom message
  273. */
  274. typedef struct _NvDsCustomMsgInfo {
  275. void *message;
  276. guint size;
  277. }NvDsCustomMsgInfo;
  278. /**
  279. * Holds payload metadata.
  280. */
  281. typedef struct NvDsPayload {
  282. /** Holds a pointer to the payload. */
  283. gpointer payload;
  284. /** Holds the size of the payload. */
  285. guint payloadSize;
  286. /** Holds the ID of the component (plugin) which attached the payload
  287. (optional). */
  288. guint componentId;
  289. } NvDsPayload;
  290. #ifdef __cplusplus
  291. }
  292. #endif
  293. #endif /* NVDSMETA_H_ */
  294. /** @} */