Animetrics Face Recognition

FREEMIUM
Door animetrics | Bijgewerkt il y a 19 jours | Media
Health Check

N/A

Terug naar alle discussies

Detect API on MashApe doesn't work when selecting file instead of url

Rapid account: Vollucris
vollucris
il y a 9 ans

I just signed up and wanted to test the functionality using the test environment here in Mashape and when I try to use the Detect test selecting a .jpg file to upload, I get this error:
{
“errors”: {
“url”: “url or image field required”
}
}
The image field IS set, why is it still giving an error?
When I tried with a url, it works fine but not with a file upload. Does the picture have to be in a specific format? What am I missing?

Thanks,
Cristi

Rapid account: Animetrics
animetrics Commented il y a 9 ans

Glad that you were able to try it out. I issued a ticket to mashape to fix last week. Hopefully they will get to it soon. Thanks for catching it.

Rapid account: Vollucris
vollucris Commented il y a 9 ans

Yes, curl works from the command line and it does what it should just fine. I was just having trouble testing it here in the interface. Thanks for looking into that. I see it’s still not fixed. Maybe they get around to fix it soon.

Thanks!

Rapid account: Animetrics
animetrics Commented il y a 9 ans

Ok thanks, sorry for the trouble. Looks like an issue with their test endpoint for a binary form field. I will issue a ticket to mashape to fix. If you have curl available on your machine, please try the command in my previous post.

Rapid account: Vollucris
vollucris Commented il y a 9 ans

Wait, I haven’t gotten to use my code yet. I’m still using the test environment from Mashape. I go to the Detect API portion and I have the option to Choose a file for the detect which I understand it is required if you don’t have an url for an image. Fine, so I leave the url empty and Choose a .jpg file from my computer. When I click on TEST ENDPOINT I get the error I mentioned above.

Rapid account: Animetrics
animetrics Commented il y a 9 ans

Hi Cristi,

Can you post the code that you are using? Keep in mind that the image field requires the actual image data. Curl will read that in for you from a file using the @ syntax. So an example using curl would be:

    curl -H "X-Mashape-Key: YOUR_MASHAPE_KEY" -F "api_key=YOUR_API_KEY" -F "image=@/path/to/local/file" https://animetrics.p.mashape.com/detect

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen