mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* sync SDK changes according to performance benchmarks * fix end-of-file lint * fix clang-format issue * fix clang-format by adding 'clang-format off' * remove useless casts * remove 'data' argument of 'operator()' * change 'Tensor2Img' to 'TensorToImg' according to spec * correct tensor's name according spec Co-authored-by: lvhan028 <lvhan_028@163.com>
37 lines
908 B
C++
37 lines
908 B
C++
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
#ifndef MMDEPLOY_SRC_PIPELINE_PIPELINE_H_
|
|
#define MMDEPLOY_SRC_PIPELINE_PIPELINE_H_
|
|
|
|
#include "graph/common.h"
|
|
|
|
namespace mmdeploy::graph {
|
|
|
|
class Pipeline : public BaseNode {
|
|
public:
|
|
explicit Pipeline(const Value& cfg);
|
|
|
|
void Build(TaskGraph& graph) override;
|
|
|
|
private:
|
|
enum BindingType { kRead, kWrite };
|
|
|
|
std::vector<int> UpdateBindings(const std::vector<std::string>& names, BindingType type);
|
|
|
|
Result<void> Call(Context& ctx, int idx);
|
|
Result<void> Ret(Context& ctx, int idx);
|
|
|
|
private:
|
|
vector<unique_ptr<Node>> nodes_;
|
|
vector<int> input_idx_;
|
|
vector<int> output_idx_;
|
|
vector<vector<int>> node_input_idx_;
|
|
vector<vector<int>> node_output_idx_;
|
|
std::map<std::string, int> binding_name_to_idx_;
|
|
std::map<int, std::string> binding_idx_to_name_;
|
|
};
|
|
|
|
} // namespace mmdeploy::graph
|
|
|
|
#endif // MMDEPLOY_SRC_PIPELINE_PIPELINE_H_
|