Close

Cloud API doesn't working like in the web page

Anything and everything related to using Sighthound Cloud

Moderator: Staff

no avatar
bruno95
 
Posts: 1
Joined: Tue Mar 06, 2018 6:20 am

Cloud API doesn't working like in the web page

by bruno95 » Tue Mar 06, 2018 6:37 am

Hi,
I am using your vehicle recognition to detect a car licence plate and very often it returns a "null" value -> '{"image":{"width":1378,"height":1098,"orientation":1},"requestId":"d14f0efc1db94e86a48be147e285b8cc","objects":[]}'.

But if put the same image in your web page, i get a licence plate as result.
Can you help me? maybe i'm doing something wrong.
Her is my code (python):

for i in listdir(my_dir):
headers = {"Content-type": "application/json",
"X-Access-Token": "my token"}

conn = http.client.HTTPSConnection("dev.sighthoundapi.com",
context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))

image_data = base64.b64encode(open(img_paste_output + i, "rb").read())
params = json.dumps({"image": image_data.decode('ascii')})
conn.request("POST", "https://dev.sighthoundapi.com/v1/recognition?objectType=licenseplate", params, headers)
response = conn.getresponse()
result = str(response.read())
...do something with the result

no avatar
Madi123
 
Posts: 1
Joined: Fri Jul 13, 2018 6:04 am
Location: United Kingdom

Re: Cloud API doesn't working like in the web page

by Madi123 » Fri Jul 13, 2018 6:28 am

Thank you for the information.


Return to API Discussion
cron