How to use only the detection and ocr part of toolbox ?
calibretaliation opened this issue · 5 comments
Hello, Im very appreciate your work and attempt to do something using it. However, I found that my work only requires parts of your pipeline, not all the steps.
So are there any methods or function that help me with this problem ?
Thank you very much đồng hương :D
We are glad that you are interested in our small project.
According to the issue title, you only need to execute two independent detection and ocr modules on the pipeline, right?
You can refer to the run.py
source code here. It is simply a manual of our modules and a standalone executable. You can initialize as follows.
det_model = Detection(
config_path=det_config,
weight_path=det_weight)
ocr_model = OCR(
config_path=ocr_config,
weight_path=ocr_weight)
Then you can execute them as follows:
det_model(img,
crop_region=True,
return_result=False,
output_path=crop_output_folder)
img_paths = list(glob(f'{crop_output_folder}/*')
texts = ocr_model.predict_folder(img_paths, return_probs=False)
With crop_output_folder
is croped output detection folder path.
You can also view the inference steps and the corresponding expected results in the notebook , under Inference modules on Personal ID
and Inference modules on Invoice
The project has stopped for maintenance, but we still appreciate your interest. We are happy to answer your questions and your contributions to our work.
Thanks, đồng hương xD
@nhtlongcs đối với detect ảnh chứng minh thư thì cần dùng khoảng bao nhiêu ảnh training để có thể detect được đầy đủ các vùng vậy b
@nhtlongcs đối với detect ảnh chứng minh thư thì cần dùng khoảng bao nhiêu ảnh training để có thể detect được đầy đủ các vùng vậy b
@whoisltd Chúng mình không có dữ liệu eKYC đã gán nhãn mà chỉ thực hiện 1 vài experiment trên đó, positive cases mình đã update trong notebook. Mình không có dữ liệu chứng minh thư cũng như không training dữ liệu đó trong repo này.
Hello again,
I am still working on a similar project as yours, and stucking at the stage of information correction and retrieval.
Can you please inform me some information of your correction steps ?
I have tons of questions about your correction module: Trie and TrieNode, can you provide me some sources to learn about these and their ideas of spelling correction ?
Also, as I understand, are you checking the spelling base on your self-build dictionary, or a self-learning mechanics like nlp ?
I am a learner so many thanks for you support, and of course I really really want to use your pre-built package, but Im a learner therefore I want to deal with this problem with your guides :D
Thanks thanks thanks veryyyy muchhhh
Hello again, I am still working on a similar project as yours, and stucking at the stage of information correction and retrieval. Can you please inform me some information of your correction steps ? I have tons of questions about your correction module: Trie and TrieNode, can you provide me some sources to learn about these and their ideas of spelling correction ? Also, as I understand, are you checking the spelling base on your self-build dictionary, or a self-learning mechanics like nlp ? I am a learner so many thanks for you support, and of course I really really want to use your pre-built package, but Im a learner therefore I want to deal with this problem with your guides :D Thanks thanks thanks veryyyy muchhhh
Hi @calibretaliation, sorry for the latency reply cause we are working on our thesis defense.
For the correction step, the main idea is if the difference score is below a threshold, the text will be replaced by the most similar in our self-build dictionary. There are 2 methods available in our toolbox, the default is using the diff_correction
method.
-
trie_correction: Trie is just a data structure to manage a list of strings and exists a way to check if the string is in the trie or not, the searching complexity is O(m) with m is the length of the query text. The score is based on the length ratio of the prefix text and the whole query. Read more at https://vnoi.info/wiki/algo/data-structures/trie.md
-
diff_correction: This one is just the Levenshtein distance function " the Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one word into the other.". Details https://en.wikipedia.org/wiki/Levenshtein_distance and https://vnoi.info/wiki/algo/dp/basic-problems.md#3-bi%E1%BA%BFn-%C4%91%E1%BB%95i-x%C3%A2u
Again, we appreciate your spirit of learning and hope this answer is still helpful for you now.