Last updated 2 months ago
from aibrary import AiBrary aibrary = AiBrary() # 1 aibrary.ocr( providers="google", file=open("tests/assets/ocr-test.jpg", "rb").read(), file_name="test.jpg", ) # 2 aibrary.ocr( providers="google", file_url="https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/5_python-ocr.jpg", ) # 3 aibrary.ocr( providers="google", file="tests/assets/ocr-test.jpg" )
true
false
POST /v0/ocr/ocr HTTP/1.1 Host: api.aibrary.dev Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: multipart/form-data Accept: */* Content-Length: 215 { "providers": "text", "settings": "text", "response_as_dict": true, "attributes_as_list": false, "show_base_64": true, "show_original_response": false, "file": "binary", "file_url": "text", "file_password": "text", "language": "text" }
Successful Response
{ "text": "text", "bounding_boxes": [ { "text": "text", "left": 1, "top": 1, "width": 1, "height": 1 } ], "status": "text" }