# Acceleration of TextDetectionModel\_DB and TextRecognitionModel model

**URL:** <https://forum.opencv.org/t/acceleration-of-textdetectionmodel-db-and-textrecognitionmodel-model/5269>\
**Category:** Uncategorized\
**Tags:** cuda, nvidia, text, dnn\
**Created:** [September 17, 2021, 1:34pm UTC](https://forum.opencv.org/t/acceleration-of-textdetectionmodel-db-and-textrecognitionmodel-model/5269 "2021-09-17T13:34:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaNe09](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@KaNe09](https://forum.opencv.org/u/KaNe09)\
**Post date:** [September 17, 2021, 1:34pm UTC](https://forum.opencv.org/t/acceleration-of-textdetectionmodel-db-and-textrecognitionmodel-model/5269/1 "2021-09-17T13:34:21Z")

</div>

I followed the example [OpenCV: samples/dnn/text\_detection.cpp](https://docs.opencv.org/master/db/da4/samples_2dnn_2text_detection_8cpp-example.html)

I did inference with my own images and the runtime is about 100ms. This is to slow for my usecase. Now, I want to accelerate the runtime. How can I do this?

I found TensorRT but if I use it, how do I set the modell settings like setBinaryThreshold(binThresh) / .setPolygonThreshold(polyThresh) / .setMaxCandidates(maxCandidates) / .setUnclipRatio(unclipRatio)?
