Dnn textrecognition model onnx

Hello folks.

I’m new to the opencv api and most of all new to dnn technologies.
My final goal is to code a personnal ocr program. I achieved using exemple (compiling, building & executing) textscenespotting. It work fine, but :
I want to use another recognition model. It works fine with crnn.onnx or crnn_cs_CN.onnx. Alright, but is it possible to use another onnx model.
I’ve downloaded some others like CRNN_VGG_BiLSTM_CTC.onnx. But none of them works. Why? What should I do in order to use another recognitions model with cv:dnn:textrecognition module. Should I convert with pytorch? Can I train my own model to create a crnn.onnx like model .
My question in fact is what should I know about onnx model to find (or train) another ocr model. Finally is this possible or the textrecognitionmodel work only with crnn.onnx, crnn_cs.onnx and crnn_cs_CN.onnx files?
I have a lot of image data file a all with coordinates of the texts in it and the words themself . Can I train by myself a onnx with this data that could better match with my specific future images to be detected. Is pyTorch the tool for It?

thanks for reading despite the fact I am a “noob”

how would we know ? what kind of errors are you getting ?

the textrecognitionmodel has a special way of parsing the network output, optimized for the existing crnn models. did you try to load them with a plain dnn::Net ?

Yes you’re right, how could you know, lol, in fact I don’t really want to know why but more simply want to know if they are compatible with the method used in the tutorial scenetextspotting or if they are not usable at all. Because they seems to be proposed in the wiki (using --recModelPath=CRNN_VGG_BiLSTM_CTC.onnx for exemple), have I to change source code for recognizer parameters? But you 're right I don’t have explored the plain dnn:net yet, I will try. I don’t know enough about dnn, sorry for my question and thanks for reading

I really need to study crnn onnx models to understand how they work with the dnn api, I can’t go further until this.

Thank you.

And a great sorry, I don’t know what I’ve done (maybe have work too late :slight_smile: ) but --recModelPath=CRNN_VGG_BiLSTM_CTC.onnx work fine.

Discussion closed , really sorry

1 Like