curl --request GET \
--url https://backend.identifai.net/api/classification/xai/{identifier} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://backend.identifai.net/api/classification/xai/{identifier}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://backend.identifai.net/api/classification/xai/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend.identifai.net/api/classification/xai/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://backend.identifai.net/api/classification/xai/{identifier}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://backend.identifai.net/api/classification/xai/{identifier}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.identifai.net/api/classification/xai/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"Download an XAI map
Download the Attention Map or the Attention Graph produced by the XAI – eXplainable AI scope for a model, for an image submitted with with_xai=true or for a frame of a video submitted with with_xai=true (use the identifier of the frame in results.images).
The maps produced depend on the model: the explanations of the per-model results list the type and method of every map available for the model, also when the AI-powered explanations were not requested. The heatmap of the Smart Full Analysis is not an XAI map: download it with the heatmap endpoint.
Note: This endpoint also has an alias available at /api/classification_image/xai/{identifier}.
curl --request GET \
--url https://backend.identifai.net/api/classification/xai/{identifier} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://backend.identifai.net/api/classification/xai/{identifier}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://backend.identifai.net/api/classification/xai/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend.identifai.net/api/classification/xai/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://backend.identifai.net/api/classification/xai/{identifier}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://backend.identifai.net/api/classification/xai/{identifier}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.identifai.net/api/classification/xai/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"Authorizations
Your API key.
Path Parameters
The identifier of the image, or of the video frame.
Query Parameters
The name of the model that produced the map, as reported in the model field of the per-model results (e.g. Revelio).
The XAI method used to compute the map.
legrad, transformer_attribution, attention_rollout The map to download: attention_map (overlaid on the original content) or attention_graph (trend and peaks of the attention of the model).
attention_map, attention_graph Response
The XAI map, as an image.
The response is of type file.