Open yatendray opened 7 years ago
I am experiencing the same issue. I believe you have to retrain the neural net powering SwiftOCR to handle different fonts.
P.S. to do the retraining, view the instructions towards the bottom of the main readme file.
I was getting garbage when I did a small test. The documentation for this framework is somewhat lacking and a lot of the issues have no response from the developer. I did the training, but how do you make use of the OCR-Network file that is created? I was really hoping this framework was going to do well for a few reasons:
SwiftOCR can't recognise multi line text. Only if you want to recognise short, single line alphanumeric strings (e.g. AB54ND84) you should consider using SwiftOCR.
@kevinmlong I developed SwiftOCR for a free time project (now I use a highly customised version of SwiftOCR) I have and never intended changing the OCR-Network File during runtime. You can change it, but it is a ugly solution with global variables (maybe I should rewrite SwiftOCR using better coding style 😉).
import SwiftOCR
recognizableCharacters = "abc...ABC...123" // Characters you trained SwiftOCR on (in the same order!)
let ocrNetworkURL = Bundle.main.url(forResource: "OCR-Network", withExtension: nil)! // URL of the OCR-Network file
globalNetwork = FFNN.fromFile(ocrNetworkURL)!
After setting the globalNetwork
and the recognizableCharacters
, you can use your custom OCR Network file.
I am trying both Tesseract and SwiftOCR paraller. I have implemented your just 6 lines of code. Tesseract recognise all images except your image (YourImage) And SwiftOCR recognise only this image not others.
images.zip
Please help.