Object Detection
3 min
The below parameters are for various Object Detection attacks. To know more about the different attack input parameters see Object Detection
The values presented below are examples taken from the YOLO model used in the reference implementation. It is important to customize these values to achieve the best performance for your particular model.
Json Payload
{
"normalize_data": "yes",
"model_framework": "onnx",
"defense_bestonly": "no",
"model_api_details": "na",
"use_model_api": "no",
}Model anaylsis
POST
https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse
Path Parameters
- model_idstring
Header Parameters
- x-api-keystringrequiredDescription
- Org_idstringrequiredDescription
python
import requests
modelID="<< Enter Model ID >>"
url = "https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/"+modelID+""
# please select proper payload for your usecase for extraction, evasion or poisoning.
payload={
# <<Enter Payload Data>>
}
headers = {
'Accept': 'application/json',
'x-api-key': '########################################',
'Org-Id': '####################################################################################################'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)curl
modelID="<< Enter Model ID >>"
curl --location 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/${modelID}' \
--header 'x-api-key: ########################################' \
--header 'Org-Id: ####################################################################################################' \
--header 'Content-Type: application/json' \
--data '{
<<Enter Payload Data>>
}'nodejs
var request = require('request');
modelID = '<<Enter Model ID >>'
var options = {
'method': 'POST',
'url': 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/'+modelID+'',
'headers': {
'x-api-key': '########################################',
'Org-Id': '####################################################################################################',
'Content-Type': 'application/json'
},
body: JSON.stringify({
// <<Enter Task Pair based Payload>>
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("x-api-key", "########################################");
myHeaders.append("Org-Id", "####################################################################################################");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
// << Enter Payload Details based on Task pair >>
});
var modelID = "<< Enter Model ID >>"
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/"+modelID+"", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));200
// 200 OK: Returns a JSON object containing unique model ID and urls to upload required files.401
// 401 Unauthorized: Returns an error message if the provided API key or Org-ID is invalid or expired.400
// 400 Bad request Error: Returns an error message if the application cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, etc.)412
// 412 precondition failed: Returns an error message if access to the target resource has been denied. (For example- if any of the parameter value is incorrect or license has expired)Note: In the response, job_id and dashboard link will be available. Save these which would be used to track progress and download artifacts.
- For using Nodejs sample code, install npm package request
- Given sample code for python is tested for Python version 3.7
- Given Sample code for nodejs and javascript is tested for Node V20LTS