Files
FastDeploy/fastdeploy/vision/ppseg/model.h
huangjianhui a8458e6729 Add new model PaddleSeg (#30)
* 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>
2022-07-21 15:38:21 +08:00

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