NVIDIA DeepStream SDK API Reference

7.1 Release
image_meta_producer.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #pragma once
14 
15 #include <sstream>
16 #include <iomanip>
17 #include <fstream>
18 #include <chrono>
19 #include <ctime>
20 #include "image_meta_consumer.h"
21 #include "concurrent_queue.h"
22 
24 {
25 public:
26  // left: filepath for multiple file, right: file content
27  typedef std::pair<std::string, std::string> string_pair;
29  struct IPData
30  {
31  float confidence = 0.f;
33  unsigned class_id = 0;
34  unsigned current_frame = 0;
35  unsigned video_stream_nb = 0;
36  std::string class_name;
37  std::string video_path;
40  std::string datetime;
41  unsigned img_height = 0;
42  unsigned img_width = 0;
43  unsigned img_top = 0;
44  unsigned img_left = 0;
45  };
46 
51  bool stack_obj_data(IPData &data);
56  void generate_image_full_frame_path(const unsigned stream_source_id,
57  const std::string &datetime_iso8601);
59  std::string get_image_full_frame_path_saved();
60 
61 private:
62 
64  std::string make_csv_data(const IPData &data);
66  std::string make_json_data(const IPData &data);
68  std::string make_kitti_data(const IPData &data);
70  std::string make_kitti_save_path() const;
71 
72  std::string image_full_frame_path_saved_;
73  std::vector<std::string> obj_data_csv_;
74  std::vector<std::string> obj_data_json_;
75  std::vector<std::string> obj_data_kitti_;
76  ImageMetaConsumer &ic_;
77 };
ImageMetaProducer::IPData::img_height
unsigned img_height
Definition: image_meta_producer.h:41
ImageMetaProducer::IPData::within_confidence
bool within_confidence
Definition: image_meta_producer.h:32
ImageMetaProducer::IPData
Content that will converted to string and sent to consumer.
Definition: image_meta_producer.h:29
ImageMetaProducer::IPData::video_path
std::string video_path
Definition: image_meta_producer.h:37
ImageMetaProducer::IPData::confidence
float confidence
Definition: image_meta_producer.h:31
ImageMetaProducer::string_pair
std::pair< std::string, std::string > string_pair
Definition: image_meta_producer.h:27
ImageMetaProducer::get_image_full_frame_path_saved
std::string get_image_full_frame_path_saved()
Returns locally stored path to complete image.
ImageMetaProducer::ImageMetaProducer
ImageMetaProducer(ImageMetaConsumer &ic)
Constructor registering a consumer.
ImageMetaProducer::IPData::img_width
unsigned img_width
Definition: image_meta_producer.h:42
ImageMetaConsumer
Definition: image_meta_consumer.h:36
image_meta_consumer.h
ImageMetaProducer::IPData::image_full_frame_path_saved
std::string image_full_frame_path_saved
Definition: image_meta_producer.h:38
ImageMetaProducer::IPData::img_left
unsigned img_left
Definition: image_meta_producer.h:44
ImageMetaProducer::IPData::datetime
std::string datetime
Definition: image_meta_producer.h:40
ImageMetaProducer::stack_obj_data
bool stack_obj_data(IPData &data)
store metadata information locally before send it.
ImageMetaProducer::IPData::image_cropped_obj_path_saved
std::string image_cropped_obj_path_saved
Definition: image_meta_producer.h:39
ImageMetaProducer::IPData::current_frame
unsigned current_frame
Definition: image_meta_producer.h:34
ImageMetaProducer::IPData::img_top
unsigned img_top
Definition: image_meta_producer.h:43
ImageMetaProducer::IPData::video_stream_nb
unsigned video_stream_nb
Definition: image_meta_producer.h:35
ImageMetaProducer::IPData::class_id
unsigned class_id
Definition: image_meta_producer.h:33
ImageMetaProducer::send_and_flush_obj_data
void send_and_flush_obj_data()
send metadata stored (after some processing for KITTI type).
ImageMetaProducer
Definition: image_meta_producer.h:23
ImageMetaProducer::generate_image_full_frame_path
void generate_image_full_frame_path(const unsigned stream_source_id, const std::string &datetime_iso8601)
Create and store locally a path to a complete image.
ImageMetaProducer::IPData::class_name
std::string class_name
Definition: image_meta_producer.h:36
concurrent_queue.h