Sure, thanks.
Hi @codeswept and all the others,
thanks for the hint pointing towards AIforEarth. I got my API key but I am still not able to get a species analysis. This is what I do so far:
- get a picture with my camera
- upload that picture to cloudinary. Cloudinary gives me a mediaURL.
- connect via Web_API to AIforEarth with POST and giving the mediaURL as body. Is that correct? The documentation of AI for Earth is totally useless. I always get â500 - internal server errorâŚâ.
Has anybody had success in using AIforEarth, and if so, how?
I guess that the body of the POST message should contain the picture in base64 encoded, but in thunkable or cloudinary there is no base64 encoder.
@Michael_Rogulla Iâm glad to hear someone else is trying this!
I got exactly as far as you did. I read through dozens of documentation pages and tried dozens of ways of POSTing an image url but I either get a 500 internal server error or I get an error about an unsupported media type. I even thought to try base64 but didnât get anywhere with that (only a half-hearted try).
Iâm really wondering if it can handle external urls at all. AI for Earth has a âblobâ image server and it may be that the tool only works on images stored there. I sure hope not, though.
I havenât even managed to add the API in my app. Still trying⌠Where can I get the API key from? I havenât been able to understand anything from the documents you shared @tatiang.
As a teacher, I requested an API by clicking the âRequest an API keyâ link at AI for Earth Tech Resources - Microsoft AI.
But even after several hours of trying, I wasnât able to get the Web API call to work.
On the other hand, itâs really easy to get the built-in image recognition to work. Itâs just not all that reliable or detailed (âdogâ vs. âgolden retrieverâ).
Hi @codeswept , @tatiang and the others,
her is what I did:
- I requested an API key and got a link with login information for an AI4earth server
- there I could find my credentials under my user settings. It consists of two keys, a primary key and a secondary key. I could find no information whatâs the difference.
- then I made a simple app in ThunkableX with a camera, a mediaDB (=Cloudinary) and a Web_API component
- you need to configure the Web_API component in designer mode like this:
â the Web_API URL should look like this: https://aiforearth.azure-api.net/species-classification/v2.0/predict?topK=3&predictMode=classifyAndDetect
â your API key goes here: enter " Ocp-Apim-Subscription-Key in Headers property, enter your primary key in âValueâ and click on âAddâ. - the mediaDB must be configured with CloudName, APIkey and APIsecret from Cloudinary.
â I am not sure but I hope to find a way that cloudinary delivers a base64 encoded image, otherwise we all need a Web-Service that converts a picture (from the cloudinary âmediaURLâ) into a base64 encoded string. I think thatâs the missing part in using AI4earth.
Here is how my blocks look like. I alway get â500 - internal server error blablablaâŚâ. Maybe all will go well with base64 encoded pictures. I am also not sure how to enter the data into the body, maybe I have to use an object, or a JSON-String?
That seems to be a lot of work⌠thanks for sharing that @Michael_Rogulla! Iâm still trying to figure out how it works.
Hi!
I am trying to add a âsearchâ option so users can only view reports of certain species, like if they search âcatâ then reports from âcatâ are supposed to come from Airtable. This is my code, thatâs not working:
Where have I gone wrong?
Thanks in advance!
Are the values in your âRecognizer tagsâ column Airtable row IDs? The way you have it set up is a little circular⌠it would help if you could show what your Airtable column headers and (a little bit of) data look like.
Sure
I have created a separate DataViewer List and hidden the first one for showing filtered reports.
When you loop through âfor each item j in list,â youâre looping through the column values (#dog #blackandwhite, then #dog, then #cat, then #cow).
But your âifâ block checks to see if the value in the âRecognizer tagsâ column for an Airtable row with âjâ as the row ID is equal to the userâs input. Your Airtable is never going to have a row with row ID â#dogâ for example. Row IDs are long strings of characters that look sort of like d4590ui18572m3.
To fix this part, replace the first âget valueâ block with just the âjâ variable block. Because âjâ already contains #dog #blackandwhite (for the first row, for example). You just need to see if âjâ contains the text input.
Thank you. Very helpful
The value of the variable âjâ is just the string â#dogâ or whatever is in the Recognizer tags column in Airtable. Youâre still using j as if itâs a row id. Itâs not.
Itâs like if I told you, can you go outside and grab â#dogâ lemons from the tree? Youâd have no idea how many to get. Or take the "#dog"th person in line and give them a prize. Which one? Itâs not a row id or a number that is useful in this way.
The first step is to see if your IF condition is working. I would change the value of a label to âfoundâ or something like that right below the âifâ block. Since itâs in a loop, maybe add a vibrate block so you can tell if it works when tested on a mobile device. If you get confirmation that the IF condition is set up correctly, then move to figuring out how to display the related information.
Youâll need to know which row contained the tag inputted by the user. So youâll probably want a counter variable that increments by one each time the âfor each item j in listâ loop iterates. That way, when you find a âjâ that contains the tag, youâll know what number row (in Airtable) itâs in.
Hereâs a video by @darren that demonstrates how to search and display data from Airtable:
Also, this set of blocks:
Thanks so much! Will change the âjâ.