NVIDIA DeepStream SDK API Reference

6.4 Release
ImageMetaConsumer Class Reference

Detailed Description

Definition at line 46 of file image_meta_consumer.h.

Public Types

enum  OutputType {
  KITTI = 0,
  JSON = 1,
  CSV = 2
}
 
enum  ImageSizeType {
  FULL_FRAME,
  CROPPED_TO_OBJECT
}
 

Public Member Functions

 ImageMetaConsumer ()
 Init an object and set that the queue is stopped. More...
 
 ~ImageMetaConsumer ()
 End the job of the thread dequeing by calling stop() More...
 
void init (unsigned gpu_id, const std::string &output_folder_path, const std::string &frame_to_skip_rules_path, float min_box_confidence, float max_box_confidence, unsigned min_box_width, unsigned min_box_height, bool save_full_frame_enabled, bool save_cropped_obj_enabled, unsigned seconds_to_skip_interval, unsigned source_nb)
 Fill information in the Consumer. More...
 
void add_meta_csv (const std::string &meta)
 Add metadata to the stored concurrent queue. More...
 
void add_meta_json (const std::string &meta)
 Add metadata to the stored concurrent queue. More...
 
void add_meta_kitti (const std::pair< std::string, std::string > &meta)
 Add metadata to the stored concurrent queue. More...
 
void stop ()
 End the job of the current thread reading from the queue. More...
 
float get_min_confidence () const
 Min confidence getter. More...
 
float get_max_confidence () const
 Max confidence getter. More...
 
unsigned get_gpu_id () const
 GPU ID getter. More...
 
unsigned get_min_box_width () const
 Minimum box width getter. More...
 
unsigned get_min_box_height () const
 Minimum box height getter. More...
 
bool get_is_stopped () const
 Dequeuing thread status getter. More...
 
bool get_save_full_frame_enabled () const
 Dequeuing full frame enabled getter. More...
 
bool get_save_cropped_images_enabled () const
 Dequeuing cropped image enable getter. More...
 
NvDsObjEncCtxHandle get_obj_ctx_handle ()
 Image Save Thread Handler. More...
 
std::string make_img_path (ImageMetaConsumer::ImageSizeType ist, unsigned stream_source_id, const std::string &datetime_iso8601)
 Metadata writer for a unique file (Json or Csv) More...
 
void init_image_save_library_on_first_time ()
 Create image saving context if needed. More...
 
bool should_save_data (unsigned source_id)
 This function checks if a certain amount of time passed before the last image was saved. More...
 
void lock_source_nb (unsigned source_id)
 Lock a stream when an image save is needed in order not to save multiple images from the same stream without waiting a certain amount of time. More...
 
void data_was_saved_for_source (unsigned source_id)
 If an image was saved, then the timestamp of the last image saved is stored. More...
 
void unlock_source_nb (unsigned source_id)
 Unlock a stream when a stream was locked for image saving. More...
 

Member Enumeration Documentation

◆ ImageSizeType

Enumerator
FULL_FRAME 
CROPPED_TO_OBJECT 

Definition at line 54 of file image_meta_consumer.h.

◆ OutputType

Enumerator
KITTI 
JSON 
CSV 

Definition at line 48 of file image_meta_consumer.h.

Constructor & Destructor Documentation

◆ ImageMetaConsumer()

ImageMetaConsumer::ImageMetaConsumer ( )

Init an object and set that the queue is stopped.

◆ ~ImageMetaConsumer()

ImageMetaConsumer::~ImageMetaConsumer ( )

End the job of the thread dequeing by calling stop()

Member Function Documentation

◆ add_meta_csv()

void ImageMetaConsumer::add_meta_csv ( const std::string &  meta)

Add metadata to the stored concurrent queue.

Parameters
[in]metaMetadata as CSV string

◆ add_meta_json()

void ImageMetaConsumer::add_meta_json ( const std::string &  meta)

Add metadata to the stored concurrent queue.

Parameters
[in]metaMetadata as JSON string

◆ add_meta_kitti()

void ImageMetaConsumer::add_meta_kitti ( const std::pair< std::string, std::string > &  meta)

Add metadata to the stored concurrent queue.

Parameters
[in]metaMetadata, left is the path needed for multi_metadata_maker() right is the content to write.

◆ data_was_saved_for_source()

void ImageMetaConsumer::data_was_saved_for_source ( unsigned  source_id)

If an image was saved, then the timestamp of the last image saved is stored.

Parameters
source_idStream number for which the timestamp is saved.

◆ get_gpu_id()

unsigned ImageMetaConsumer::get_gpu_id ( ) const

GPU ID getter.

Returns
The gpu id used for encoding an object.

◆ get_is_stopped()

bool ImageMetaConsumer::get_is_stopped ( ) const

Dequeuing thread status getter.

Returns
The status of the thread reading metadata.

◆ get_max_confidence()

float ImageMetaConsumer::get_max_confidence ( ) const

Max confidence getter.

Returns
The maximum confidence required for an object.

◆ get_min_box_height()

unsigned ImageMetaConsumer::get_min_box_height ( ) const

Minimum box height getter.

Returns
The minimum box height required for an object.

◆ get_min_box_width()

unsigned ImageMetaConsumer::get_min_box_width ( ) const

Minimum box width getter.

Returns
The minimum box width required for an object.

◆ get_min_confidence()

float ImageMetaConsumer::get_min_confidence ( ) const

Min confidence getter.

Returns
The minimum confidence required for an object.

◆ get_obj_ctx_handle()

NvDsObjEncCtxHandle ImageMetaConsumer::get_obj_ctx_handle ( )

Image Save Thread Handler.

Returns
the thread handler

◆ get_save_cropped_images_enabled()

bool ImageMetaConsumer::get_save_cropped_images_enabled ( ) const

Dequeuing cropped image enable getter.

Returns
If cropped images must be saved.

◆ get_save_full_frame_enabled()

bool ImageMetaConsumer::get_save_full_frame_enabled ( ) const

Dequeuing full frame enabled getter.

Returns
If complete images must be saved.

◆ init()

void ImageMetaConsumer::init ( unsigned  gpu_id,
const std::string &  output_folder_path,
const std::string &  frame_to_skip_rules_path,
float  min_box_confidence,
float  max_box_confidence,
unsigned  min_box_width,
unsigned  min_box_height,
bool  save_full_frame_enabled,
bool  save_cropped_obj_enabled,
unsigned  seconds_to_skip_interval,
unsigned  source_nb 
)

Fill information in the Consumer.

This has to be done when these informations available.

Parameters
[in]output_folder_pathPath where all the metadata will be saved.
[in]frame_to_skip_rules_pathPath where the rules for the amount of time to skip between 2 frames is stored.
[in]min_box_confidenceMinimum confidence that an object detected on a frame should have, in order to be kept.
[in]max_box_confidenceMaximum confidence that an object detected on a frame should have, in order to be kept.
[in]gpu_idGPU ID of the gpu which is to be used for encoding
[in]min_box_widthMinimum box width that an object detected on a frame should have, in order to be kept.
[in]min_box_heightMinimum box height that an object detected on a frame should have, in order to be kept.
[in]save_full_frame_enabledEnable/Disable the save of complete images.
[in]save_cropped_obj_enabledEnable/Disable the save of cropped images
[in]seconds_to_skip_intervalUnsigned integer giving the number of seconds to skip.
[in]source_nbUnsigned integer giving the number of sources that are currently giving a stream.

◆ init_image_save_library_on_first_time()

void ImageMetaConsumer::init_image_save_library_on_first_time ( )

Create image saving context if needed.

◆ lock_source_nb()

void ImageMetaConsumer::lock_source_nb ( unsigned  source_id)

Lock a stream when an image save is needed in order not to save multiple images from the same stream without waiting a certain amount of time.

Parameters
source_idThe stream number to lock

◆ make_img_path()

std::string ImageMetaConsumer::make_img_path ( ImageMetaConsumer::ImageSizeType  ist,
unsigned  stream_source_id,
const std::string &  datetime_iso8601 
)

Metadata writer for a unique file (Json or Csv)

Parameters
extensionof file requested (Json or Csv)
stream_source_idUnique number identifying the stream source
datetime_iso8601current datetime formatted to iso 8601

◆ should_save_data()

bool ImageMetaConsumer::should_save_data ( unsigned  source_id)

This function checks if a certain amount of time passed before the last image was saved.

Parameters
source_idvideo stream number to check
Returns
True if the required amount of time has passed before last the image was saved.

◆ stop()

void ImageMetaConsumer::stop ( )

End the job of the current thread reading from the queue.

◆ unlock_source_nb()

void ImageMetaConsumer::unlock_source_nb ( unsigned  source_id)

Unlock a stream when a stream was locked for image saving.

Parameters
source_idThe stream number to unlock

The documentation for this class was generated from the following file: