Object Detection
from aibrary import AiBrary
aibrary = AiBrary()
# 1
aibrary.object_detection(
providers="google",
file=open("tests/assets/ocr-test.jpg", "rb").read(),
file_name="test.jpg",
)
# 2
aibrary.object_detection(
providers="google",
file_url="https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/5_python-ocr.jpg",
)
# 3
aibrary.object_detection(
providers="google", file="tests/assets/ocr-test.jpg"
)
Authorizations
Body
providersstringRequired
settingsany ofOptional
stringOptional
nullOptional
response_as_dictbooleanOptionalDefault:
true
attributes_as_listbooleanOptionalDefault:
false
show_base_64booleanOptionalDefault:
true
show_original_responsebooleanOptionalDefault:
false
filestring · binaryOptional
file_urlany ofOptional
stringOptional
nullOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /v0/images/object_detection HTTP/1.1
Host: api.aibrary.dev
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 174
{
"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"
}
{
"items": [
{
"label": "text",
"confidence": 1,
"x_min": null,
"x_max": null,
"y_min": null,
"y_max": null
}
]
}
Last updated