Improve ALPR_OCR peformance
This commit is contained in:
@@ -11,6 +11,9 @@ namespace onnxocr {
|
||||
class ONNXOCRDetector : public BasicOrtHandler {
|
||||
public:
|
||||
explicit ONNXOCRDetector(const std::string& onnx_path, unsigned int num_threads = 1);
|
||||
explicit ONNXOCRDetector(const std::string& onnx_path,
|
||||
const OrtHandlerOptions& options,
|
||||
unsigned int num_threads = 1);
|
||||
~ONNXOCRDetector() override = default;
|
||||
|
||||
// Run text detection on an image
|
||||
@@ -21,7 +24,12 @@ public:
|
||||
float unclipRatio = kDetUnclipRatio,
|
||||
bool useDilation = false);
|
||||
|
||||
// Pre-warm cuDNN/TRT at a canonical 320x320 input so the first real
|
||||
// call doesn't pay the algorithm-selection tax. Idempotent.
|
||||
void Warmup();
|
||||
|
||||
private:
|
||||
bool _warmedUp = false;
|
||||
Ort::Value transform(const cv::Mat& mat) override;
|
||||
Ort::Value transformBatch(const std::vector<cv::Mat>& images) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user