---
title: Object Detection
slug: object-detection
docTags: 
createdAt: 2023-06-04T07:07:12.000Z
---

The below parameters are for various Object Detection attacks. To know more about the different attack input parameters see [Object Detection](docId\:U3g1Wca-WL4Wed67BySah)

:::hint{type="info"}
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

:::CodeblockTabs
Evasion

```json
{
"normalize_data": "yes",
"model_framework": "onnx",
"defense_bestonly": "no",
"model_api_details": "na",
"use_model_api": "no",
            
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse",
  "name": "Model anaylsis",
  "method": "POST",
  "request": {
    "pathParameters": [
      {
        "name": "model_id",
        "kind": "optional",
        "type": "string",
        "description": "",
        "children": []
      }
    ],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "children": [],
        "description": "Enter your API key"
      },
      {
        "kind": "required",
        "name": "Org_id",
        "type": "string",
        "children": [],
        "description": "Enter your organization id"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "DL4HDcclTH6dUtOu-opbD",
        "code": "// 200 OK: Returns a JSON object containing unique model ID and urls to upload required files.",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "z5dS_OPIMHsxFEwrtKnkw",
        "language": "401",
        "code": "// 401 Unauthorized: Returns an error message if the provided API key or Org-ID is invalid or expired.",
        "customLabel": ""
      },
      {
        "id": "xJHL9zR5wAZ30f4gu2BUz",
        "language": "400",
        "code": "// 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.)",
        "customLabel": ""
      },
      {
        "id": "eXy7xHvpQ-HT16gZp2CNA",
        "language": "412",
        "code": "// 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)",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eXy7xHvpQ-HT16gZp2CNA"
  },
  "examples": {
    "languages": [
      {
        "id": "_mGBjlMU9k01Z6CEkara5",
        "language": "python",
        "code": "import requests\n\nmodelID=\"<< Enter Model ID >>\"\nurl = \"https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/\"+modelID+\"\"\n\n# please select proper payload for your usecase for extraction, evasion or poisoning.\npayload={\n    # <<Enter Payload Data>>\n}\nheaders = {\n   'Accept': 'application/json',\n   'x-api-key': '########################################',\n   'Org-Id': '####################################################################################################'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)",
        "customLabel": ""
      },
      {
        "id": "EZTVIARgk4Cgsi2z3kaoP",
        "language": "curl",
        "code": "modelID=\"<< Enter Model ID >>\"\ncurl --location 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/${modelID}' \\\n--header 'x-api-key: ########################################' \\\n--header 'Org-Id: ####################################################################################################' \\\n--header 'Content-Type: application/json' \\\n--data '{\n        <<Enter Payload Data>>\n}'",
        "customLabel": ""
      },
      {
        "id": "kc6RvtVQgBj0xpcZD7Nak",
        "language": "nodejs",
        "code": "var request = require('request');\n\nmodelID = '<<Enter Model ID >>'\nvar options = {\n  'method': 'POST',\n  'url': 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/'+modelID+'',\n  'headers': {\n    'x-api-key': '########################################',\n    'Org-Id': '####################################################################################################',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify({\n        // <<Enter Task Pair based Payload>>\n  })\n\n};\nrequest(options, function (error, response) {\n  if (error) throw new Error(error);\n  console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "Nx00RqrLXpofFTyDCguK0",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"x-api-key\", \"########################################\");\nmyHeaders.append(\"Org-Id\", \"####################################################################################################\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n    // << Enter Payload Details based on Task pair >>\n});\n\nvar modelID = \"<< Enter Model ID >>\"\n\nvar requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: raw,\n  redirect: 'follow'\n};\n\nfetch(\"https://api.aws.boschaishield.com/prod/api/ais/v1.5/model_analyse/\"+modelID+\"\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "_mGBjlMU9k01Z6CEkara5"
  },
  "description": "",
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  }
}
```
:::

:::hint{type="success"}
**Note**: In the response, job\_id and dashboard link will be available. Save these which would be used to track progress and download artifacts.&#x20;

- 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
:::









