Closed arsaboo closed 5 years ago
@arsaboo I can reproduce your result, I emailed them to alert them to this issue, not a good sign. Can you try the following python file?
import base64
import json
import os
import ssl
try:
import httplib # Python 2
except:
import http.client as httplib # Python 3
headers = {"Content-type": "application/json",
"X-Access-Token": "your_key_here"}
conn = httplib.HTTPSConnection("dev.sighthoundapi.com", context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))
# To use a hosted image uncomment the following line and update the URL
image_data = "http://www.allwhitebackground.com/images/3/3809.jpg"
# To use a local file uncomment the following line and update the path
#image_data = base64.b64encode(open("/path/to/local/image.jpg", "rb").read()).decode()
params = json.dumps({"image": image_data})
conn.request("POST", "/v1/detections?type=face,person&faceOption=landmark,gender", params, headers)
response = conn.getresponse()
result = response.read()
print("Detection Results = " + str(result))
That worked. Here's the output:
Detection Results = b'{"image":{"width":1050,"height":600,"orientation":1},"objects":[{"type":"face","boundingBox":{"x":241,"y":88,"height":169,"width":135},"landmarks":{"faceContour":[[243,145],[244,161],[246,178],[248,195],[253,212],[263,227],[276,240],[291,249],[309,251],[326,248],[339,238],[350,225],[357,210],[361,194],[364,180],[366,165],[366,149]],"noseBridge":[[313,142],[313,152],[313,163],[314,174]],"noseBall":[[297,180],[305,182],[312,185],[319,182],[326,179]],"eyebrowRight":[[322,133],[333,128],[344,126],[355,129],[362,137]],"eyebrowLeft":[[256,135],[265,127],[278,125],[290,127],[301,133]],"eyeRight":[[327,147],[335,142],[342,142],[349,146],[343,147],[335,147]],"eyeRightCenter":[[339,145]],"eyeLeft":[[270,145],[278,142],[286,142],[293,146],[285,147],[277,147]],"eyeLeftCenter":[[282,145]],"mouthOuter":[[277,199],[290,195],[302,193],[311,195],[320,193],[331,194],[340,198],[331,213],[320,220],[311,221],[301,220],[289,214]],"mouthInner":[[281,200],[302,198],[311,198],[320,198],[337,200],[320,211],[311,213],[302,212]]},"attributes":{"gender":"male","genderConfidence":0.9817,"frontal":true}},{"type":"face","boundingBox":{"x":546,"y":201,"height":158,"width":133},"landmarks":{"faceContour":[[568,254],[566,269],[567,283],[569,298],[572,313],[578,327],[584,341],[592,352],[604,358],[618,359],[632,354],[644,345],[656,334],[665,322],[670,307],[674,291],[678,275]],"noseBridge":[[613,259],[612,268],[610,277],[608,287]],"noseBall":[[594,290],[600,294],[607,298],[616,297],[623,297]],"eyebrowRight":[[624,250],[637,248],[650,251],[660,258],[667,268]],"eyebrowLeft":[[569,243],[575,236],[585,234],[596,238],[605,245]],"eyeRight":[[631,268],[639,266],[647,269],[654,273],[646,273],[638,271]],"eyeRightCenter":[[643,270]],"eyeLeft":[[578,254],[585,253],[592,254],[599,259],[591,259],[584,257]],"eyeLeftCenter":[[588,256]],"mouthOuter":[[585,310],[593,306],[602,305],[609,308],[616,308],[627,313],[637,321],[626,332],[614,335],[606,333],[599,331],[591,324]],"mouthInner":[[589,312],[601,310],[608,312],[616,314],[633,321],[615,326],[608,325],[600,323]]},"attributes":{"gender":"male","genderConfidence":0.9923,"frontal":true}},{"type":"face","boundingBox":{"x":0,"y":197,"height":157,"width":144},"landmarks":{"faceContour":[[10,233],[8,249],[7,266],[7,283],[10,300],[17,317],[26,333],[37,346],[52,353],[69,353],[87,345],[103,334],[118,321],[127,306],[134,289],[140,272],[144,253]],"noseBridge":[[69,250],[67,262],[64,274],[62,285]],"noseBall":[[47,285],[54,290],[60,294],[68,293],[76,292]],"eyebrowRight":[[82,243],[95,241],[108,241],[119,245],[129,251]],"eyebrowLeft":[[18,229],[29,226],[39,229],[50,233],[58,240]],"eyeRight":[[87,256],[96,252],[104,253],[112,257],[104,258],[95,257]],"eyeRightCenter":[[100,256]],"eyeLeft":[[30,240],[38,239],[46,241],[52,248],[44,246],[36,244]],"eyeLeftCenter":[[41,243]],"mouthOuter":[[27,295],[38,295],[51,297],[59,300],[69,300],[83,303],[95,307],[81,324],[66,330],[55,329],[46,326],[35,315]],"mouthInner":[[31,298],[49,301],[58,304],[68,305],[91,308],[67,321],[57,321],[48,318]]},"attributes":{"gender":"female","genderConfidence":0.9929,"frontal":true}},{"type":"face","boundingBox":{"x":630,"y":344,"height":188,"width":135},"landmarks":{"faceContour":[[632,434],[635,452],[640,468],[645,484],[654,499],[666,510],[679,520],[693,529],[709,530],[725,524],[738,514],[750,500],[759,484],[763,465],[763,444],[762,424],[760,403]],"noseBridge":[[687,404],[689,414],[690,425],[691,435]],"noseBall":[[680,448],[687,449],[695,449],[702,445],[709,442]],"eyebrowRight":[[696,388],[707,379],[720,375],[733,378],[743,386]],"eyebrowLeft":[[635,407],[640,395],[651,389],[662,388],[673,391]],"eyeRight":[[708,407],[714,402],[722,400],[731,402],[724,404],[716,406]],"eyeRightCenter":[[719,404]],"eyeLeft":[[650,417],[657,413],[664,411],[673,414],[665,415],[658,417]],"eyeLeftCenter":[[661,415]],"mouthOuter":[[670,474],[678,463],[689,458],[698,458],[706,455],[720,457],[734,464],[724,482],[711,491],[702,494],[692,494],[681,488]],"mouthInner":[[673,473],[690,463],[699,463],[708,461],[730,465],[710,483],[700,485],[691,485]]},"attributes":{"gender":"female","genderConfidence":0.949,"frontal":true}},{"type":"face","boundingBox":{"x":580,"y":51,"height":154,"width":139},"landmarks":{"faceContour":[[584,108],[587,124],[590,140],[596,155],[605,169],[618,180],[634,189],[649,195],[666,196],[681,194],[693,187],[704,176],[712,164],[716,149],[718,134],[719,119],[719,103]],"noseBridge":[[659,109],[660,119],[661,129],[661,140]],"noseBall":[[647,147],[654,148],[662,150],[668,148],[674,146]],"eyebrowRight":[[666,99],[677,94],[689,93],[700,94],[709,100]],"eyebrowLeft":[[600,105],[610,98],[623,94],[637,95],[650,99]],"eyeRight":[[674,111],[681,107],[690,107],[697,109],[691,111],[682,112]],"eyeRightCenter":[[686,110]],"eyeLeft":[[616,112],[624,109],[633,108],[641,112],[632,113],[624,114]],"eyeLeftCenter":[[628,111]],"mouthOuter":[[635,163],[645,161],[655,160],[662,161],[669,159],[679,161],[689,162],[680,172],[671,175],[663,175],[656,175],[646,171]],"mouthInner":[[639,164],[655,164],[662,165],[670,164],[685,163],[670,167],[663,167],[656,166]]},"attributes":{"gender":"male","genderConfidence":0.949,"frontal":true}},{"type":"face","boundingBox":{"x":815,"y":148,"height":172,"width":143},"landmarks":{"faceContour":[[819,220],[821,235],[824,251],[829,266],[836,282],[847,295],[859,308],[873,318],[890,320],[908,316],[925,306],[940,292],[950,276],[956,257],[956,236],[956,215],[954,194]],"noseBridge":[[868,203],[868,214],[868,225],[869,237]],"noseBall":[[860,245],[867,247],[874,249],[882,245],[890,241]],"eyebrowRight":[[875,191],[886,184],[901,183],[915,185],[927,192]],"eyebrowLeft":[[822,212],[825,202],[835,196],[847,193],[859,194]],"eyeRight":[[890,202],[897,197],[904,197],[913,198],[905,200],[898,201]],"eyeRightCenter":[[901,199]],"eyeLeft":[[836,213],[841,208],[847,207],[856,208],[849,210],[842,211]],"eyeLeftCenter":[[845,210]],"mouthOuter":[[854,266],[860,260],[869,259],[878,259],[887,257],[901,256],[915,259],[905,274],[892,281],[882,283],[873,283],[863,278]],"mouthInner":[[857,266],[870,261],[879,261],[888,259],[913,260],[890,276],[881,278],[872,278]]},"attributes":{"gender":"male","genderConfidence":0.9919,"frontal":true}},{"type":"face","boundingBox":{"x":431,"y":295,"height":178,"width":141},"landmarks":{"faceContour":[[443,327],[438,348],[433,371],[431,393],[435,414],[444,433],[455,451],[468,465],[483,473],[497,472],[509,461],[522,447],[535,435],[547,421],[558,407],[564,392],[569,376]],"noseBridge":[[528,350],[526,361],[524,371],[521,382]],"noseBall":[[499,385],[506,389],[513,394],[521,394],[527,393]],"eyebrowRight":[[544,339],[554,338],[563,340],[570,346],[572,355]],"eyebrowLeft":[[472,319],[485,315],[498,315],[510,321],[520,330]],"eyeRight":[[536,360],[545,358],[553,361],[557,366],[550,365],[543,363]],"eyeRightCenter":[[547,362]],"eyeLeft":[[482,339],[492,339],[500,342],[506,348],[497,346],[489,343]],"eyeLeftCenter":[[494,343]],"mouthOuter":[[465,399],[481,396],[498,398],[506,401],[515,402],[524,407],[527,416],[517,436],[507,446],[497,446],[487,442],[474,428]],"mouthInner":[[468,402],[495,401],[504,404],[513,406],[524,416],[510,436],[501,437],[492,434]]},"attributes":{"gender":"female","genderConfidence":0.9708,"frontal":true}},{"type":"face","boundingBox":{"x":149,"y":338,"height":178,"width":149},"landmarks":{"faceContour":[[154,410],[161,430],[168,449],[175,467],[185,483],[199,497],[215,508],[233,516],[249,515],[263,507],[274,491],[282,474],[289,456],[290,436],[289,416],[287,396],[285,375]],"noseBridge":[[223,392],[226,403],[229,414],[232,425]],"noseBall":[[220,436],[227,436],[235,437],[241,433],[246,428]],"eyebrowRight":[[233,374],[242,367],[252,363],[263,364],[271,370]],"eyebrowLeft":[[166,399],[173,389],[183,382],[195,379],[207,381]],"eyeRight":[[239,392],[245,385],[253,382],[262,385],[255,388],[247,390]],"eyeRightCenter":[[250,387]],"eyeLeft":[[183,407],[190,400],[198,397],[207,401],[200,403],[192,405]],"eyeLeftCenter":[[195,402]],"mouthOuter":[[205,460],[215,450],[228,446],[237,446],[245,442],[258,441],[268,445],[262,466],[252,478],[243,482],[233,483],[218,477]],"mouthInner":[[209,460],[229,450],[238,449],[247,446],[265,447],[249,471],[240,475],[230,475]]},"attributes":{"gender":"female","genderConfidence":0.9923,"frontal":true}},{"type":"face","boundingBox":{"x":775,"y":345,"height":161,"width":141},"landmarks":{"faceContour":[[782,397],[779,411],[779,425],[782,440],[788,455],[795,470],[803,485],[811,499],[823,506],[840,505],[859,499],[878,489],[895,476],[907,459],[913,438],[915,416],[916,394]],"noseBridge":[[815,390],[813,400],[810,409],[806,418]],"noseBall":[[802,427],[807,431],[813,433],[820,432],[828,430]],"eyebrowRight":[[828,376],[840,370],[854,368],[867,371],[880,377]],"eyebrowLeft":[[780,375],[784,369],[790,369],[798,371],[804,376]],"eyeRight":[[840,394],[847,389],[856,389],[865,392],[856,394],[848,394]],"eyeRightCenter":[[852,392]],"eyeLeft":[[787,391],[793,387],[800,388],[807,393],[799,393],[792,393]],"eyeLeftCenter":[[796,391]],"mouthOuter":[[800,449],[803,443],[810,441],[816,443],[823,442],[838,445],[855,451],[841,468],[826,475],[818,475],[811,473],[805,465]],"mouthInner":[[803,449],[810,446],[816,447],[824,447],[852,451],[825,467],[817,467],[811,465]]},"attributes":{"gender":"female","genderConfidence":0.9858,"frontal":true}},{"type":"person","boundingBox":{"x":766,"y":149,"height":421,"width":284}},{"type":"person","boundingBox":{"x":57,"y":269,"height":324,"width":274}},{"type":"person","boundingBox":{"x":577,"y":295,"height":297,"width":250}},{"type":"person","boundingBox":{"x":230,"y":202,"height":391,"width":381}},{"type":"person","boundingBox":{"x":2,"y":133,"height":460,"width":165}},{"type":"person","boundingBox":{"x":514,"y":16,"height":370,"width":281}},{"type":"person","boundingBox":{"x":204,"y":11,"height":429,"width":271}}],"requestId":"f825ed129b474bf6a49c3803b12305cd"}'
Well appears this is resolved, I am not sure if it was an issue with the image or your key, but anyways
I keep getting an error
I tried the curl command and get the same error:
Changing the order in the curl command works. So, the following works: