How to use google vision whit webapi and json i need help

Hello i wanted a component for google vision , but that will take a time , and i think , in this plataform have a json and web api , and i can make a post to google vision whit my key to make it works , But this its the problem i dont know how to do it , i read the tutorial of web api but i dont untherstant to much , can anyone tell me where to read to do this?

I only want to take a picture and make a POST to google vision api and then get that “tags” and “descriptions” to save it in firebase for example

Okay i did it¡¡¡ , Only need to do its copy the example in google api documents and paste in the body of the web api , now i need to know how to extract from json xD

@angelshce22, Do you have to use the Google Vision API? We have an Image Recognizer component (see docs here) that uses Microsoft’s Vision API. Perhaps that will be sufficient for your needs.

-Mark

I know we have a image tecognizer component , But dont work well , micrsosoft if u draw a triangle in your skin only can say its a tatto , google vision can say , its your arm,tatto,triangle,and the color ,

Fair enough.

As for your question about how to extract data from JSON, the easiest way use our Get object from JSON block and then use the get property of object block to pull out the pieces. See here for some more information.

-Mark

Thank u¡ have a nice day , i will try it :smiley:

i have this output
{
“responses”: [
{
“labelAnnotations”: [
{
“mid”: “/m/0bt9lr”,
“description”: “dog”,
“score”: 0.97346616
},

and i did this

i am doing right? becouse not working xD , i want to get all of the scores and then select the first score or the second

Okay i did it , i take a onlinne path for json to know the correct path

Next step will be to take more than 1 description or score

The thing is, you need to know what the types of each property are. So, for example, “responses” will be a list (aka an array in JSON language), as will “labelAnnotations”. You can tell this from the fact that the value of those properties start with a “[” in the JSON (another clue is that the property name ends in an “s”).

So, since those properties are lists, you probably want to loop over the responses, select the first label annotation and then do whatever you need to do with value of that label annotation’s “score” property (e.g. add it to list, append it to a string, etc).

-Mark

Hi Angel,
I know this is over a year old but I’m trying to do the same thing. I cant figure out where my API key goes, what URL to use, and what header/ parameter is needed.

Can you send me a snippet of how you laid this out.

Thanks in advance.

Hello¡

for all want to see how i did it

I use a https://jsonpathfinder.com/ to get the correct path for json

1 Like

Angelsche22,

Thankyou for sharing this. Unfortunately I’m still stuck on an earlier section. Can you send me what you input here.

I’ve signed up with google and have an API key. But I’m not sure where it goes.

Again thankyou for your help.

In URL put “https://vision.googleapis.com/v1/images:annotate?key=YourKey

headers :

text: { “requests”:[ { “image”:{ “source”:{ “imageUri”: “https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png” } }, “features”:[ { “type”:“LOGO_DETECTION”, “maxResults”:1 } ] } ] }

POST: { “requests”:[ { “image”:{ “source”:{ “imageUri”: “https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png” } }, “features”:[ { “type”:“LOGO_DETECTION”, “maxResults”:1 } ] } ] }

(for example)

Then u can set the body , depends what u want if u want label detection or image for example

{ “requests”: [ { “image”: { “source”: { “imageUri”: “testur” } }, “features”: [ { “type”: “LABEL_DETECTION”, “maxResults”: 1 } ] } ] }

here is the json of the request (body)

here Vision AI | Extrae información valiosa de imágenes mediante ML u can put a image and see the json request to put into body

1 Like