Welcome to LQ!
You have not actually asked a question that can be answered specifically by anyone not familiar with your software or image data. The basic problem as you have described it is purely mathematical, being the
total number of accurate recognitions divided by
the total number of recognition attempts. As such it is really just a simple division of one number by another. So, your problem is one of obtaining the numbers and performing the division.
As you have said it is all working fine, presumably you can keep an internal count of attempts and successes easily enough to produce those numbers.
If you need help with the code to do that, you will need to provide much more detail about your own project's code and identify the point at which it knows whether a recognition was successful or not. At that point you simply need to keep two variables updated then divide one by the other to produce the basic success rate, trivial in python.
In general when asking for such help it is best to show what you have done so far, to provide a useful context for those offering help, and the demonstrate your own level of knowledge. While others here are willing to help, most are not interested in writing a complete solution for you without effort demonstrated on your part.
Please also review the
Site FAQ for guidance in asking complete and well formed questions. The link at bottom of that page, How To Ask Questions The Smart Way is a very good guide!
Good luck!