Hi @saymongriffin! The problem here is that this particular code is tailored towards our Concept Models (e.g. General, NSFW, Food, Apparel, etc.) which simply return concepts and their corresponding probabilities. Those have a JSON return structure of:
"data": {
"concepts": [
{
"id": "ai_HLmqFqBf",
"name": "train",
"app_id": null,
"value": 0.9989112
},
{
"id": "ai_fvlBqXZR",
"name": "railway",
"app_id": null,
"value": 0.9975532
},
{
"id": "ai_Xxjc3MhT",
"name": "transportation system",
"app_id": null,
"value": 0.9959158
},
{
"id": "ai_6kTjGfF6",
"name": "station",
"app_id": null,
"value": 0.992573
},
...etc...
The Focus Model however, returns all the regions in focus (via bounding box coordinates), the focus score of that region and an overall focus score, so it's structure is a bit different:
"data": {
"focus": {
"value": 0.96578157
},
"regions": [
{
"region_info": {
"bounding_box": {
"top_row": 0.328125,
"left_col": 0.28125,
"bottom_row": 0.84375,
"right_col": 0.71875
}
},
"data": {
"focus": {
"density": 0.72727275
}
}
}
]
In the example above, the picture has only one focus region, but there could potentially be many.
Let me know if you need further help with this!