Skip to content

Is it possible to get the angle of rotation of the text area via PaddleOCR? #13264

Answered by UserWangZz
Aflexg asked this question in Q&A
Discussion options

You must be logged in to vote

You can see this part code in paddleocr.py, if you use paddleocr api. About 755 line, use a classifier model to det the det model's result. and then you can find second part code in tools/infer/predict_cls.py. Here use cls model to rectify det box.

PaddleOCR/paddleocr.py

Lines 725 to 762 in 7a3c580

if det and rec:
ocr_res = []
for idx, img in enumerate(imgs):
img = preprocess_image(img)
dt_boxes, rec_res, _ = self.__call__(img, cls, slice)
if not dt_boxes and not rec_res:
ocr_res.append(None)
continue
tmp_res = [[box.tolist(), res] for box, res in zip(dt_boxes, rec_res)]
ocr_res.append(tmp_res)
return ocr_res
elif det and not

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@Aflexg
Comment options

@UserWangZz
Comment options

Answer selected by Aflexg
@Aflexg
Comment options

@Aagam2
Comment options

@Aflexg
Comment options

@Aagam2
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants