Improve ALPR_OCR peformance
This commit is contained in:
@@ -11,6 +11,9 @@ namespace onnxocr {
|
||||
class ONNXOCRClassifier : public BasicOrtHandler {
|
||||
public:
|
||||
explicit ONNXOCRClassifier(const std::string& onnx_path, unsigned int num_threads = 1);
|
||||
explicit ONNXOCRClassifier(const std::string& onnx_path,
|
||||
const OrtHandlerOptions& options,
|
||||
unsigned int num_threads = 1);
|
||||
~ONNXOCRClassifier() override = default;
|
||||
|
||||
// Classify text orientation for a list of cropped images
|
||||
@@ -21,7 +24,12 @@ public:
|
||||
std::vector<float>& cls_scores,
|
||||
float cls_thresh = kClsThresh);
|
||||
|
||||
// Pre-warm cuDNN/TRT for the classifier's fixed [1,3,80,160] shape.
|
||||
// Idempotent — no-op after the first call.
|
||||
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