Output will be a list, each item only contains bounding box, ,, ], ,, ], ,, ]įrom paddleocr import PaddleOCR ocr = PaddleOCR ( lang = 'en' ) # need to run only once to load model into memory img_path = 'PaddleOCR/doc/imgs_words_en/word_10.png' result = ocr. convert ( 'RGB' ) im_show = draw_ocr ( image, result, txts = None, scores = None, font_path = '/path/to/PaddleOCR/doc/fonts/simfang.ttf' ) im_show = Image. ocr ( img_path, rec = False ) for line in result : print ( line ) # draw result from PIL import Image image = Image. Output will be a list, each item contains recognition text and confidence įrom paddleocr import PaddleOCR, draw_ocr ocr = PaddleOCR () # need to run only once to download and load model into memory img_path = 'PaddleOCR/doc/imgs_en/img_12.jpg' result = ocr. ocr ( img_path, det = False, cls = True ) for line in result : print ( line ) save ( 'result.jpg' )įrom paddleocr import PaddleOCR ocr = PaddleOCR ( use_angle_cls = True, lang = 'en' ) # need to run only once to load model into memory img_path = 'PaddleOCR/doc/imgs_words_en/word_10.png' result = ocr. convert ( 'RGB' ) boxes = for line in result ] txts = for line in result ] scores = for line in result ] im_show = draw_ocr ( image, boxes, txts, scores, font_path = '/path/to/PaddleOCR/doc/fonts/simfang.ttf' ) im_show = Image. ocr ( img_path, cls = False ) for line in result : print ( line ) # draw result from PIL import Image image = Image. Output will be a list, each item contains bounding box, text and recognition confidence, ,, ], ], ,, ], ], ,, ], ]įrom paddleocr import PaddleOCR, draw_ocr ocr = PaddleOCR ( lang = 'en' ) # need to run only once to download and load model into memory img_path = 'PaddleOCR/doc/imgs_en/img_12.jpg' result = ocr. ocr ( img_path, cls = True ) for line in result : print ( line ) # draw result from PIL import Image image = Image. ocr = PaddleOCR ( use_angle_cls = True, lang = 'en' ) # need to run only once to download and load model into memory img_path = 'PaddleOCR/doc/imgs_en/img_12.jpg' result = ocr. # You can set the parameter `lang` as `ch`, `en`, `french`, `german`, `korean`, `japan` # to switch the language model in order.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |