force_submodel

Updated: 28-6-2023

Description

Forces processing of the image using the specified submodel.

force_submodel example force_submodel example result using algorithm=msm-eur:christmas2022-0.5.1,api=api-v2:alpha-0.5.3-20230212

Values

  • Plantae
  • Chordata
  • Fungi
  • Insecta
  • Lepidoptera
  • Diptera
  • Arthropoda
  • Animalia

Example request

Get test image

Requires curl and jq.

curl \
    -X POST \
    -F "image=@14262050.jpg" \
    -F "force_submodel=Plantae" \
    "https://multi-source.identify.biodiversityanalysis.eu/v2/observation/identify" | \
jq

Requires the Python requests library. Available with pip install requests.

import json

import requests


def example_request():
    url = (
        "https://multi-source.identify."
        "biodiversityanalysis.eu/v2/"
        "observation/identify"
    )
    test_image = "buteo2.jpg"
    data = {"force_submodel": "Plantae"}

    with open(test_image, "rb") as image:
        response = requests.post(
            url=url,
            files={"image": image},
            data=data,
        )
    return response.json()


if __name__ == "__main__":
    json_response = example_request()
    print(json.dumps(json_response, indent=2))

Example response

{
  "api_implementation": {
    "tag": "api-v2:2.1.0-20230616",
    "version": "49476035"
  },
  "generated_by": {
    "datetime": "2023-06-28T12:20:33.953322",
    "parameters": {
      "force_submodel": "Plantae"
    },
    "tag": "algorithm=msm-eur:1.1-20230619,api=api-v2:2.1.0-20230616",
    "version": "algorithm=df722733dc3eb9647870d237c918cecd0d8aabeb,api=49476035"
  },
  "identification": {
    "image": {
      "confidence": "confident"
    }
  },
  "links": {
    "taxa": {
      "url": "v2/taxa/main_order"
    },
    "taxa_with_filter": {
      "url": "v2/taxa/main_order?id={taxon_id}"
    }
  },
  "media": [
    {
      "filename": "14262050",
      "id": "image0"
    }
  ],
  "model_implementation": {
    "algorithm_tag": "msm-eur:1.1-20230619",
    "tag": "main_order",
    "version": "df722733dc3eb9647870d237c918cecd0d8aabeb"
  },
  "predictions": [
    {
      "region_group_id": "image0?region=full",
      "taxa": {
        "items": [
          {
            "probability": 0.997732,
            "scientific_name": "Echium vulgare",
            "scientific_name_id": "GBIF:2925892"
          },
          {
            "probability": 0.002107,
            "scientific_name": "Echium",
            "scientific_name_id": "GBIF:2925888"
          },
          {
            "probability": 0.000161,
            "scientific_name": "Echium plantagineum",
            "scientific_name_id": "GBIF:2925895"
          },
          {
            "probability": 0,
            "scientific_name": "Echium italicum",
            "scientific_name_id": "GBIF:2925889"
          },
          {
            "probability": 0,
            "scientific_name": "Thymbra capitata",
            "scientific_name_id": "GBIF:5607804"
          },
          {
            "probability": 0,
            "scientific_name": "Carduus crispus",
            "scientific_name_id": "GBIF:3114649"
          },
          {
            "probability": 0,
            "scientific_name": "Carduus",
            "scientific_name_id": "GBIF:3114511"
          },
          {
            "probability": 0,
            "scientific_name": "Camphorosma monspeliaca",
            "scientific_name_id": "GBIF:6035827"
          },
          {
            "probability": 0,
            "scientific_name": "Carduus acanthoides",
            "scientific_name_id": "GBIF:3114643"
          },
          {
            "probability": 0,
            "scientific_name": "Erica scoparia",
            "scientific_name_id": "GBIF:7946667"
          }
        ],
        "type": "multiclass"
      }
    }
  ],
  "region_groups": [
    {
      "id": "image0?region=full",
      "individual_id": "individual0",
      "regions": [
        {
          "box": {
            "x1": 0.125,
            "x2": 0.875,
            "y1": 0,
            "y2": 1
          },
          "id": "image0?region=full",
          "media_id": "image0"
        }
      ]
    }
  ]
}