NVIDIA Holoscan SDK v2.6.0
v2.6.0

Program Listing for File holoinfer.hpp

Return to documentation for file (modules/holoinfer/src/include/holoinfer.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 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_SRC_INCLUDE_HOLOINFER_HPP #define MODULES_HOLOINFER_SRC_INCLUDE_HOLOINFER_HPP #include <iostream> #include <map> #include <memory> #include <string> #include <vector> #include "holoinfer_buffer.hpp" namespace holoscan { namespace inference { class ManagerProcessor; class _HOLOSCAN_EXTERNAL_API_ InferContext { public: InferContext(); ~InferContext(); InferStatus set_inference_params(std::shared_ptr<InferenceSpecs>& inference_specs); InferStatus execute_inference(std::shared_ptr<InferenceSpecs>& inference_specs, cudaStream_t cuda_stream = 0); DimType get_output_dimensions() const; DimType get_input_dimensions() const; private: std::string unique_id_; }; class _HOLOSCAN_EXTERNAL_API_ ProcessorContext { public: ProcessorContext(); InferStatus initialize(const MultiMappings& process_operations, const std::string config_path); InferStatus process(const MultiMappings& tensor_oper_map, const MultiMappings& in_out_tensor_map, DataMap& processed_result_map, const std::map<std::string, std::vector<int>>& dimension_map, bool process_with_cuda, cudaStream_t cuda_stream = 0); DataMap get_processed_data() const; DimType get_processed_data_dims() const; private: std::shared_ptr<ManagerProcessor> process_manager_; }; } // namespace inference } // namespace holoscan #endif/* MODULES_HOLOINFER_SRC_INCLUDE_HOLOINFER_HPP */

© Copyright 2022-2024, NVIDIA. Last updated on Oct 29, 2024.