mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-16 13:41:30 +08:00

* Support new model PaddleSeg * Fix conflict * PaddleSeg add visulization function * fix bug * Fix BindPPSeg wrong name * Fix variable name * Update by comments * Add ppseg-unet example python version Co-authored-by: Jason <jiangjiajun@baidu.com>
36 lines
998 B
C++
36 lines
998 B
C++
#pragma once
|
|
#include "fastdeploy/fastdeploy_model.h"
|
|
#include "fastdeploy/vision/common/processors/transform.h"
|
|
#include "fastdeploy/vision/common/result.h"
|
|
|
|
namespace fastdeploy {
|
|
namespace vision {
|
|
namespace ppseg {
|
|
|
|
class FASTDEPLOY_DECL Model : public FastDeployModel {
|
|
public:
|
|
Model(const std::string& model_file, const std::string& params_file,
|
|
const std::string& config_file,
|
|
const RuntimeOption& custom_option = RuntimeOption(),
|
|
const Frontend& model_format = Frontend::PADDLE);
|
|
|
|
std::string ModelName() const { return "ppseg"; }
|
|
|
|
virtual bool Predict(cv::Mat* im, SegmentationResult* result);
|
|
|
|
private:
|
|
bool Initialize();
|
|
|
|
bool BuildPreprocessPipelineFromConfig();
|
|
|
|
bool Preprocess(Mat* mat, FDTensor* outputs);
|
|
|
|
bool Postprocess(const FDTensor& infer_result, SegmentationResult* result);
|
|
|
|
std::vector<std::shared_ptr<Processor>> processors_;
|
|
std::string config_file_;
|
|
};
|
|
} // namespace ppseg
|
|
} // namespace vision
|
|
} // namespace fastdeploy
|