Spaces:
Runtime error
Runtime error
Bug fix of result changed to result[0] in new version (#5)
Browse files- Bug fix of result changed to result[0] in new version (2be332839fadb98b4753fce53b7a0a496a2e3472)
Co-authored-by: Yassine Alouini <[email protected]>
app.py
CHANGED
@@ -11,7 +11,7 @@ torch.hub.download_url_to_file('https://i.imgur.com/aqMBT0i.jpg', 'example.jpg')
|
|
11 |
def inference(img, lang):
|
12 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
13 |
img_path = img.name
|
14 |
-
result = ocr.ocr(img_path, cls=True)
|
15 |
image = Image.open(img_path).convert('RGB')
|
16 |
boxes = [line[0] for line in result]
|
17 |
txts = [line[1][0] for line in result]
|
|
|
11 |
def inference(img, lang):
|
12 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
13 |
img_path = img.name
|
14 |
+
result = ocr.ocr(img_path, cls=True)[0]
|
15 |
image = Image.open(img_path).convert('RGB')
|
16 |
boxes = [line[0] for line in result]
|
17 |
txts = [line[1][0] for line in result]
|