NVIDIA DeepStream SDK API Reference

9.2 Release
sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #pragma once
19 
20 #include <string>
21 #include <vector>
22 #include <map>
23 #include <utility>
24 #include <cstdint>
25 
29 struct GTBox
30 {
31  std::string class_label;
32  float x1, y1, x2, y2;
33 };
34 
44 using GTKey = std::pair<std::string, uint32_t>;
45 using GTIndex = std::map<GTKey, std::vector<GTBox>>;
46 
47 enum class GtFormat {
48  KITTI,
49  NVSCHEMA,
50  COCO,
51  TAO,
52  UNKNOWN
53 };
54 
58 GtFormat gt_detect_format (const std::string &path);
59 
65 bool gt_load (const std::string &path, GTIndex &index,
GTBox::x1
float x1
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:32
gt_detect_format
GtFormat gt_detect_format(const std::string &path)
Detect the format of the GT file or directory at path.
GtFormat::KITTI
@ KITTI
GTBox::y2
float y2
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:32
GTBox
GTBox: one ground-truth bounding box in absolute pixel coordinates.
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:29
GtFormat::UNKNOWN
@ UNKNOWN
GTBox::class_label
std::string class_label
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:31
GtFormat::COCO
@ COCO
GTBox::x2
float x2
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:32
GTIndex
std::map< GTKey, std::vector< GTBox > > GTIndex
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:45
GtFormat
GtFormat
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:47
GtFormat::NVSCHEMA
@ NVSCHEMA
GTKey
std::pair< std::string, uint32_t > GTKey
GTKey: (camera_id, frame_num).
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:44
GtFormat::TAO
@ TAO
GTBox::y1
float y1
Definition: sources/gst-plugins/gst-nvinfereval/nvds_eval_gt_loader.h:32
gt_load
bool gt_load(const std::string &path, GTIndex &index, GtFormat fmt=GtFormat::UNKNOWN)
Load ground truth from path into index.