Spaces:
Sleeping
Sleeping
import requests | |
from paddleocr import PaddleOCR, draw_ocr | |
from PIL import Image | |
import gradio as gr | |
img = "input_data/ocr_input/Japan+Billboard.jpg" | |
def inference(img, lang): | |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False) | |
img_path = img | |
result = ocr.ocr(img_path, cls=True)[0] | |
image = Image.open(img_path).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] | |
return txts | |
print(inference(img,"korean")) | |
#balls | |