Skip to content

Process Images

Note: The image redaction API is experimental and is not included in Redactor by default. Contact Sighthound to gain access.

HTTP Request

POST /api/v1/images:process

Request Body

Fields
inputUri
Required
string
URI which points to a single image for input
features
Required
Items Enum: PERSON_DETECTION, HEAD_DETECTION, FACE_DETECTION, VEHICLE_DETECTION, LICENSE_PLATE_DETECTION, ID_DETECTION, SCREEN_DETECTION, DOCUMENT_DETECTION, MEDIA_RENDERING
String array of the desired processing features
  • PERSON_DETECTION - Detect people
  • HEAD_DETECTION - Detect heads (v6+)
  • FACE_DETECTION - Detect faces
  • VEHICLE_DETECTION - Detect vehicles
  • LICENSE_PLATE_DETECTION - Detect vehicle license plates
  • ID_DETECTION - Detect identification like driver's licenses, passports, and other IDs (v7+)
  • SCREEN_DETECTION - Detect screens like monitors, laptops, and phones (v7+)
  • DOCUMENT_DETECTION - Detect documents and other papers (v7+)
  • MEDIA_RENDERING - Render redacted image and/or metadata. Required if output is desired.
outputUri
Required
string
The URI to use for output. If the outputUri ends in a trailing slash, the redacted image will be saved as image.jpg inside of that directory, overwriting any existing file with the same name. If the outputUri does not end with trailing slash, it will be used as the the filename for the redacted, output image.
notifications Array of objects (NotificationConfig)
Notification webhook descriptor. Users can enable webhooks to receive start, progress, and completion messages for their operation.
imageContext object (ImageContext)
Additional configuration options. All optional.
tag object
User-defined object that is returned in every notification.

Types

NotificationConfig

Fields
method string
"HTTP_POST" is currently the only option
uri string
The storage bucket URI to use for output
events Array of string
Items Enum: "START" "PROGRESS" "COMPLETION"

ImageContext

Fields
renderConfig object (RenderConfig)

RenderConfig

Fields
exportMetadata boolean
Default: false
Experimental feature in v4.5.0+ which outputs a JSON file with the raw, detection data.
imageQuality number [ 0 .. 1 ]
Default: 0.65
Image compression quality which impacts the size of output. 0 is the lowest quality, 1 is highest, and 0.65 is the default.

Response Body

A success response returns an object with an Operation name in the format:
projects/{project-id}/locations/{location-id}/operations/{operation-id}

RESPONSE SCHEMA: application/json
name string<operationName>

Samples

Request

{
  "inputUri": "http://example.com/path/to/image.jpg",
  "features": [
    "FACE_DETECTION",
    "LICENSE_PLATE_DETECTION",
    "MEDIA_RENDERING"
  ],
  "outputUri": "file:///path/to/output/image-redacted.jpg",
  "notifications": [
    {
      "method": "HTTP_POST",
      "uri": "https://myhost/mywebhook/endpoint",
      "events": [
        "COMPLETION"
      ]
    }
  ],
  "imageContext": {
    "renderConfig": {
      "exportMetadata": true
    }
  },
  "tag": {
    "myid": 1607111026726
  }
}

Response

{
  "name": "projects/{project-id}/locations/{location-id}/operations/{operation-id}"
}