@#DENVERSON TAN JING WEI# Does your prediction endpoint respond when you try to classify directly from the custom vision portal?
I am not really an expert at using react native but the implementation mentioned here seems to work according to the author. Could you try something similar with your implementation if the prediction API works directly from the portal?
async sendToMicrosoftPrediction(img_url) {
let response = await fetch(PREDICTION_URL, {
method: "POST",
headers: {
"Prediction-Key": PREDICTION_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
Url: img_url
})
});
let bodyText = JSON.parse(response["_bodyText"]);
let predictions = bodyText["predictions"];
this.setNewPrediction(predictions);
}
Hello there! thank you for reaching out. My code was based on the link you mentioned. I realised reading the prediction results does not need to be so complicated. all i need is just this line:
const data = await response.json();
so basically all it does is to extract the data when receiving the response. :) thank you!