mmdeploy/csrc/codebase/mmocr/cuda/connected_component.h
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

38 lines
793 B
C++

// Copyright (c) OpenMMLab. All rights reserved
#ifndef FAST_CC__CONNECTED_COMPONENT_H_
#define FAST_CC__CONNECTED_COMPONENT_H_
#include <cstdint>
#include <memory>
#include <utility>
#include <vector>
#include "opencv2/core.hpp"
namespace mmdeploy {
class ConnectedComponents {
public:
explicit ConnectedComponents(void* stream);
~ConnectedComponents();
void Resize(int height, int width);
int GetComponents(const uint8_t* d_mask, int* h_label);
void GetContours(std::vector<std::vector<cv::Point>>& corners);
void GetStats(const uint8_t* d_mask, const float* d_score, std::vector<float>& scores,
std::vector<int>& areas);
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace mmdeploy
#endif // FAST_CC__CONNECTED_COMPONENT_H_