Go to the source code of this file.
Data Structures | |
| struct | ClassThreshold |
| Structure to hold class label and its confidence threshold. More... | |
Functions | |
| std::vector< ClassThreshold > | fetch_class_labels_with_thresholds (const std::string &labels_file, PrettyLogger *logger) |
| Fetch class labels and thresholds from a labels file. More... | |
| std::vector< std::string > | extract_class_labels (const std::vector< ClassThreshold > &class_thresholds) |
| Extract class label strings from ClassThreshold vector. More... | |
| void | attach_bbox3d_to_display (NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta, const torch::Tensor &camera_frames, const torch::Tensor &boxes_3d, const torch::Tensor &labels_3d, const torch::Tensor &instance_ids, const torch::Tensor &scores_3d, int img_width, int img_height, const std::vector< std::string > &class_labels, const std::string &bbox_color_mode, const bool &display_class_labels, const bool &display_instance_ids, const bool &display_class_score, PrettyLogger *logger) |
| Attach 3D bounding boxes to display metadata for visualization. More... | |
| void | clamp_point (float *x, float *y, int img_width, int img_height) |
| Clamps a point to stay within image boundaries. More... | |
| void | calculate_centroid (const float *points, float *centroid) |
| Calculates the centroid of a 3D bounding box from its 2D projection. More... | |
| void | get_color_from_label (const std::string &label, float *red, float *green, float *blue, int num_classes) |
| Generates a consistent color based on a class label. More... | |
| void | get_color_from_instance_id (int64_t instance_id, float *red, float *green, float *blue) |
| Generates a color based on instance ID for tracking visualization. More... | |
| bool | count_visible_corners (const float *points, int num_corners, int img_width, int img_height) |
| Counts visible corners of a 3D bounding box. More... | |
| void | attach_bbox2d_to_objectmeta (NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta, const torch::Tensor &bbox2d, const torch::Tensor &boxes_3d, const torch::Tensor &labels_3d, const torch::Tensor &instance_ids, const torch::Tensor &scores_3d, const std::vector< std::string > &class_labels, const std::string &bbox_color_mode, const bool &display_2d_bbox, PrettyLogger *logger) |
| Attach 2D bounding boxes as NvDsObjectMeta to frame metadata. More... | |
| void attach_bbox2d_to_objectmeta | ( | NvDsBatchMeta * | batch_meta, |
| NvDsFrameMeta * | frame_meta, | ||
| const torch::Tensor & | bbox2d, | ||
| const torch::Tensor & | boxes_3d, | ||
| const torch::Tensor & | labels_3d, | ||
| const torch::Tensor & | instance_ids, | ||
| const torch::Tensor & | scores_3d, | ||
| const std::vector< std::string > & | class_labels, | ||
| const std::string & | bbox_color_mode, | ||
| const bool & | display_2d_bbox, | ||
| PrettyLogger * | logger | ||
| ) |
Attach 2D bounding boxes as NvDsObjectMeta to frame metadata.
| batch_meta | DeepStream batch metadata |
| frame_meta | DeepStream frame metadata |
| bbox2d | Tensor containing 2D bounding boxes [N, 4] where 4 = [x, y, w, h] |
| boxes_3d | Tensor containing 3D bounding box information |
| labels_3d | Tensor containing class labels |
| instance_ids | Tensor containing instance IDs for tracking |
| scores_3d | Tensor containing confidence scores |
| class_labels | Vector of class label strings |
| bbox_color_mode | Color mode: "class_id" for class-based or "instance_id" for instance-based colors |
| display_2d_bbox | Whether to display 2D bounding boxes on frames |
| logger | Logger for debug and warning messages |
| void attach_bbox3d_to_display | ( | NvDsBatchMeta * | batch_meta, |
| NvDsFrameMeta * | frame_meta, | ||
| const torch::Tensor & | camera_frames, | ||
| const torch::Tensor & | boxes_3d, | ||
| const torch::Tensor & | labels_3d, | ||
| const torch::Tensor & | instance_ids, | ||
| const torch::Tensor & | scores_3d, | ||
| int | img_width, | ||
| int | img_height, | ||
| const std::vector< std::string > & | class_labels, | ||
| const std::string & | bbox_color_mode, | ||
| const bool & | display_class_labels, | ||
| const bool & | display_instance_ids, | ||
| const bool & | display_class_score, | ||
| PrettyLogger * | logger | ||
| ) |
Attach 3D bounding boxes to display metadata for visualization.
This function processes 3D bounding box projections and attaches them to the DeepStream display metadata for visualization on the frame.
| batch_meta | DeepStream batch metadata |
| frame_meta | DeepStream frame metadata |
| camera_frames | Tensor containing projected 3D bbox coordinates |
| boxes_3d | Tensor containing 3D bounding box coordinates |
| labels_3d | Tensor containing label indices |
| instance_ids | Tensor containing instance IDs |
| scores_3d | Tensor containing confidence scores |
| img_width | Width of the image |
| img_height | Height of the image |
| class_labels | Vector of class label strings |
| bbox_color_mode | Color mode for bounding boxes (class_id or instance_id) |
| display_class_labels | Whether to display class labels |
| display_instance_ids | Whether to display instance IDs |
| display_class_score | Whether to display class confidence score |
| logger | Logger for debug and warning messages |
| void calculate_centroid | ( | const float * | points, |
| float * | centroid | ||
| ) |
Calculates the centroid of a 3D bounding box from its 2D projection.
| points | Array of 2D points |
| centroid | Array to store centroid coordinates |
| void clamp_point | ( | float * | x, |
| float * | y, | ||
| int | img_width, | ||
| int | img_height | ||
| ) |
Clamps a point to stay within image boundaries.
| x | X-coordinate to clamp |
| y | Y-coordinate to clamp |
| img_width | Image width |
| img_height | Image height |
| bool count_visible_corners | ( | const float * | points, |
| int | num_corners, | ||
| int | img_width, | ||
| int | img_height | ||
| ) |
Counts visible corners of a 3D bounding box.
| points | Array of 2D points |
| num_corners | Number of corners |
| img_width | Image width |
| img_height | Image height |
| std::vector<std::string> extract_class_labels | ( | const std::vector< ClassThreshold > & | class_thresholds | ) |
Extract class label strings from ClassThreshold vector.
| class_thresholds | Vector of ClassThreshold structures |
| std::vector<ClassThreshold> fetch_class_labels_with_thresholds | ( | const std::string & | labels_file, |
| PrettyLogger * | logger | ||
| ) |
Fetch class labels and thresholds from a labels file.
This function reads class labels and their confidence thresholds from a file where each entry is in format: class_name:threshold; Example: Person:0.85;Vehicle:0.90;
| labels_file | Path to the file containing class labels and thresholds |
| logger | Logger for debug and warning messages |
| void get_color_from_instance_id | ( | int64_t | instance_id, |
| float * | red, | ||
| float * | green, | ||
| float * | blue | ||
| ) |
Generates a color based on instance ID for tracking visualization.
| instance_id | Instance ID |
| red | Output red component [0-1] |
| green | Output green component [0-1] |
| blue | Output blue component [0-1] |
| void get_color_from_label | ( | const std::string & | label, |
| float * | red, | ||
| float * | green, | ||
| float * | blue, | ||
| int | num_classes | ||
| ) |
Generates a consistent color based on a class label.
| label | Class label string |
| red | Output red component [0-1] |
| green | Output green component [0-1] |
| blue | Output blue component [0-1] |
| num_classes | Number of unique classes |