I am working with Paddle OCR, I would like to know what is the output format for bbx off paddle OCR. I can not find in the github of Paddle. Here is my code.
from paddleocr import PaddleOCR,draw_ocr
ocr = PaddleOCR(use_angle_cls=False, lang='en', rec=False) # need to run only once to download and load model into memory
result = ocr.ocr(img, cls=False)
Output
[[[[8.0, 12.0], [89.0, 12.0], [89.0, 25.0], [8.0, 25.0]],
('@kheengz_yfk', 0.9460259079933167)],
[[[6.0, 31.0], [227.0, 29.0], [227.0, 44.0], [6.0, 46.0]],
('EBIT is a week old today. and', 0.847086489200592)],
[[[4.0, 47.0], [225.0, 49.0], [225.0, 64.0], [4.0, 62.0]],
('the homebors came together...Seemore', 0.942597508430481)],
[[[7.0, 70.0], [183.0, 70.0], [183.0, 83.0], [7.0, 83.0]],
('Joriginal sound-kheengz_yfk(Cont', 0.8839073181152344)]]
I want to manually draw Bounding Boxes against it.
My thinking is that first is x0,y0(top left) and last is x1,y1(bot right)
rect = cv2.rectangle(img.copy(), (int(result[0][0][0][0]), int(result[0][0][0][1])), (int(result[0][0][-1][0]),int(result[0][0][-1][0]) ), (0, 255, 0), -1)
plt.imshow(rect)
But this does not work correctly. Any help in this. Thanks.
Testing Image.
Orignal Paddle OCR draw_ocr output.
from PIL import Image
image = Image.fromarray(img).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
im_show = draw_ocr(image, boxes, txts, scores, font_path='/usr/share/fonts/opentype/malayalam/Chilanka-Regular.otf')
plt.imshow(im_show)