image
Updated: 28-6-2023Description
Image data as multipart/form-data
. Up to 10 images can be identified as part of one observation. This means that it is assumed that multiple images are pictures of the same subject.
Example request
Requires curl
and jq
.
curl \
-X POST \
-F "image=@27127725.jpg" \
-F "image=@27127726.jpg" \
"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_1 = "27127725.jpg"
test_image_2 = "27127726.jpg"
with open(test_image_1, "rb") as image_1:
with open(test_image_2, "rb") as image_2:
response = requests.post(
url=url,
files=(
("image", image_1),
("image", image_2),
),
)
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:30:22.323669",
"parameters": {},
"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": "27127725",
"id": "image0"
},
{
"filename": "27127726",
"id": "image1"
}
],
"model_implementation": {
"algorithm_tag": "msm-eur:1.1-20230619",
"tag": "main_order",
"version": "df722733dc3eb9647870d237c918cecd0d8aabeb"
},
"predictions": [
{
"region_group_id": "individual0",
"taxa": {
"items": [
{
"probability": 0.995506,
"scientific_name": "Rorippa austriaca",
"scientific_name_id": "GBIF:3053406"
},
{
"probability": 0.002862,
"scientific_name": "Bunias orientalis",
"scientific_name_id": "GBIF:3050364"
},
{
"probability": 0.001321,
"scientific_name": "Rorippa armoracioides",
"scientific_name_id": "GBIF:3693306"
},
{
"probability": 0.000171,
"scientific_name": "Rorippa amphibia",
"scientific_name_id": "GBIF:3053201"
},
{
"probability": 6.3e-5,
"scientific_name": "Lepidium latifolium",
"scientific_name_id": "GBIF:5376692"
},
{
"probability": 4.1e-5,
"scientific_name": "Armoracia rusticana",
"scientific_name_id": "GBIF:3041022"
},
{
"probability": 6e-6,
"scientific_name": "Brassica nigra",
"scientific_name_id": "GBIF:3042658"
},
{
"probability": 4e-6,
"scientific_name": "Brassica juncea",
"scientific_name_id": "GBIF:3042751"
},
{
"probability": 4e-6,
"scientific_name": "Sisymbrium austriacum subsp. chrysanthum",
"scientific_name_id": "GBIF:3046925"
},
{
"probability": 3e-6,
"scientific_name": "Rorippa",
"scientific_name_id": "GBIF:3053118"
}
],
"type": "multiclass"
}
}
],
"region_groups": [
{
"id": "individual0",
"individual_id": "individual0",
"regions": [
{
"box": {
"x1": 0,
"x2": 1,
"y1": 0.125,
"y2": 0.875
},
"id": "image0?region=full",
"media_id": "image0"
},
{
"box": {
"x1": 0,
"x2": 1,
"y1": 0.125,
"y2": 0.875
},
"id": "image1?region=full",
"media_id": "image1"
}
]
}
]
}