lzhangzz 5e51739485
[Feature] Support DBNet, PANet and PSENet for SDK, with GPU aided post-processing (#526)
* add SDK support for PANet

* fix panet

* fix panet

* simplify panet

* add PSENet support

* fix-psenet

* add CUDA post-processing for DBNet

* fix dbnet

* fix dbnet

* add cpu support for PANet

* fix panet

* add CUDA support for PANet

* fix panet

* format

* add cpu impls for PSENet

* fix psenet

* add cuda impl for PSENet

* fix psenet

* add param parsing

* simplify impls

* simplify impls

* clean-up

* fix lint

* fix cuda-10 build

* fix cuda-10 build
2022-05-31 21:24:09 +08:00

44 lines
1.3 KiB
C++

// Copyright (c) OpenMMLab. All rights reserved.
#ifndef MMDEPLOY_CSRC_CODEBASE_MMOCR_PANET_H_
#define MMDEPLOY_CSRC_CODEBASE_MMOCR_PANET_H_
#include "codebase/mmocr/mmocr.h"
#include "core/device.h"
#include "core/registry.h"
#include "core/tensor.h"
#include "opencv2/core.hpp"
namespace mmdeploy {
namespace mmocr {
class PaHeadImpl {
public:
virtual ~PaHeadImpl() = default;
virtual void Init(const Stream& stream) { stream_ = stream; }
virtual Result<void> Process(Tensor text_pred, //
Tensor kernel_pred, //
Tensor embed_pred, //
float min_text_confidence, //
float min_kernel_confidence, //
cv::Mat_<float>& text_score, //
cv::Mat_<uint8_t>& text, //
cv::Mat_<uint8_t>& kernel, //
cv::Mat_<int>& label, //
cv::Mat_<float>& embed, //
int& region_num) = 0;
protected:
Stream stream_;
};
} // namespace mmocr
MMDEPLOY_DECLARE_REGISTRY(mmocr::PaHeadImpl);
} // namespace mmdeploy
#endif // MMDEPLOY_CSRC_CODEBASE_MMOCR_PANET_H_