NVIDIA Holoscan SDK v2.0.0
Holoscan v2.0.0 Download PDF

Program Listing for File generate_boxes.hpp

Return to documentation for file (modules/holoinfer/src/process/transforms/generate_boxes.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MODULES_HOLOINFER_TRANSFORMS_GENERATE_BOXES_HPP #define MODULES_HOLOINFER_TRANSFORMS_GENERATE_BOXES_HPP #include <bits/stdc++.h> #include <cstring> #include <functional> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> #include <holoinfer.hpp> #include <holoinfer_constants.hpp> #include <holoinfer_utils.hpp> #include <process/transform.hpp> namespace holoscan { namespace inference { class GenerateBoxes : public TransformBase { public: GenerateBoxes() {} explicit GenerateBoxes(const std::string& config_path) : config_path_(config_path) {} InferStatus initialize(const std::vector<std::string>& input_tensors); InferStatus create_tensor_map(const std::vector<std::string>& input_tensors); InferStatus execute(const std::map<std::string, void*>& indata, const std::map<std::string, std::vector<int>>& indim, DataMap& processed_data, DimType& processed_dims); InferStatus execute_mask(const std::map<std::string, void*>& indata, const std::map<std::string, std::vector<int>>& indim, DataMap& processed_data, DimType& processed_dims); private: std::string config_path_; std::map<std::string, int> label_count; float threshold = 0.75; int width = 1920; int height = 1080; std::string label_file = {}; std::vector<std::string> label_strings = {"object"}; std::map<std::string, std::string> tensor_to_output_map; std::map<std::string, std::vector<float>> color_map; }; } // namespace inference } // namespace holoscan #endif/* MODULES_HOLOINFER_TRANSFORMS_GENERATE_BOXES_HPP */

© Copyright 2022-2024, NVIDIA. Last updated on Jun 4, 2024.