OChemR icon indicating copy to clipboard operation
OChemR copied to clipboard

A few questions related to above_below arrow text capture using OCR model and findArrow function

Open jun-li-2020 opened this issue 2 years ago • 1 comments

I have two questions here: i) looks like get_max_radius(bwimg,[(x1,y1),(x2,y2)]) is missing in your findArrows.py. ii) you are currently using the ocr_model = ocr_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True, assume_straight_pages = True) as the default for text image capture. Interestingly if I am using your "Backend/text_images/strychnine_20.png" file as a demo, I thought that "NaHMDS, NMP, and CuBr" text would be captured/inferred. But the blocks were empty which resulted in the error in your text_img2text.py. If I am switching to your "text_images/020a2.png" file, that was "PhCF3, 180C, 3-7 h", the OCR model did get some words in the block, but none of them was PhCF3. I am not sure if you are using any specifically trained OCR model with some chemistry ontology learned here. Thanks

jun-li-2020 avatar Jun 28 '22 15:06 jun-li-2020

Thanks for your comment!

i) I am checking the get_max_radius function in the next update.

ii) Exactly, I trained an OCR for 5 epochs such that:

python train_tensorflow.py sar_resnet31 --train_path=/train --val_path=/val --vocab chemistry --epochs 5

Samples were generated from the USPTO data set:(https://figshare.com/articles/dataset/Chemical_reactions_from_US_patents_1976-Sep2016_/5104873) using the "trdg" (https://github.com/Belval/TextRecognitionDataGenerator)

markmartorilopez avatar Jul 15 '22 10:07 markmartorilopez