VART-X  0.3.0
vart_postprocess_impl_base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024-2026 Advanced Micro Devices Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
24 #include <cstdint>
25 #include <memory>
26 #include <string>
27 #include <vector>
28 #include "../vart_inferresult.hpp"
29 #include "../vart_memory.hpp"
30 #include "../vart_memory_types.hpp"
31 #include "../vart_postprocess_types.hpp"
32 
35 namespace vart {
36 
44  public:
46  PostProcessImplBase() = default;
47 
49  virtual ~PostProcessImplBase() {}
50 
64  virtual void set_config(std::vector<TensorInfo>& info, uint32_t batch_size) = 0;
65 
79  virtual std::vector<std::vector<std::shared_ptr<InferResult>>> process(std::vector<int8_t*> data,
80  uint32_t current_batch_size) = 0;
81 
96  virtual std::vector<std::vector<std::shared_ptr<InferResult>>> process(
97  std::vector<std::vector<std::shared_ptr<vart::Memory>>> tensor_memory,
98  uint32_t current_batch_size) = 0;
99 };
100 
101 } // namespace vart
Abstract interface for post-processing implementation used by PostProcess.
Definition: vart_postprocess_impl_base.hpp:43
virtual ~PostProcessImplBase()
Virtual destructor to ensure proper cleanup of derived implementations.
Definition: vart_postprocess_impl_base.hpp:49
PostProcessImplBase()=default
Default construction is allowed for derived implementations.
virtual std::vector< std::vector< std::shared_ptr< InferResult > > > process(std::vector< int8_t * > data, uint32_t current_batch_size)=0
process() - Process/parse tensors data from ML network output to create infer results.
virtual void set_config(std::vector< TensorInfo > &info, uint32_t batch_size)=0
set_config() - Set PostProcessInfo config data before start doing the post-process.
virtual std::vector< std::vector< std::shared_ptr< InferResult > > > process(std::vector< std::vector< std::shared_ptr< vart::Memory >>> tensor_memory, uint32_t current_batch_size)=0
process() - Process/parse tensors data from ML network output to create infer results.
VART (Vitis AI Runtime) public API namespace.