# Google Cloud Vision

> Extract text, labels and other annotations from images and documents.

App · 5 actions. Web page: https://docs.lodol.com/docs/integrations/google-cloud-vision

## Actions

### Annotate an image

Read text or detect objects and other features.

**Inputs**

- Image URL (`image_url`, text, required): An HTTPS image URL or a Cloud Storage URI.
- Features (`features`, list, required): Choose the types of annotations to return. One or more of: `FACE_DETECTION` (Face detection), `LANDMARK_DETECTION` (Landmark detection), `LOGO_DETECTION` (Logo detection), `LABEL_DETECTION` (Label detection), `TEXT_DETECTION` (Text detection), `DOCUMENT_TEXT_DETECTION` (Document text detection), `SAFE_SEARCH_DETECTION` (Safe search detection), `IMAGE_PROPERTIES` (Image properties), `CROP_HINTS` (Crop hints), `WEB_DETECTION` (Web detection), `OBJECT_LOCALIZATION` (Object localization).
- Language hints (`language_hints`, list): Language codes to help text recognition.
- Max results (`max_results`, number): Maximum results per supported annotation type. At least 1.

**Outputs**

- `data` (object): The response from Google Cloud Vision.

**Example output**

```json
{
  "data": {
    "responses": [
      {
        "cropHintsAnnotation": {},
        "error": {},
        "faceAnnotations": [
          {}
        ],
        "fullTextAnnotation": {},
        "imagePropertiesAnnotation": {},
        "labelAnnotations": [
          {}
        ],
        "landmarkAnnotations": [
          {}
        ],
        "localizedObjectAnnotations": [
          {}
        ],
        "logoAnnotations": [
          {}
        ],
        "safeSearchAnnotation": {},
        "textAnnotations": [
          {}
        ],
        "webDetection": {}
      }
    ]
  }
}
```

### Annotate document pages

Extract document text from up to five pages of a Cloud Storage file.

**Inputs**

- Source (`source`, text, required): The gs:// URI of a file in Cloud Storage.
- Mime type (`mime_type`, text, required): The file format. One of: `application/pdf`, `image/tiff`, `image/gif`.
- Pages (`pages`, list): Page numbers to read. Leave empty to read the first five pages.

**Outputs**

- `data` (object): The response from Google Cloud Vision.

**Example output**

```json
{
  "data": {
    "responses": [
      {
        "responses": [
          {
            "cropHintsAnnotation": {},
            "error": {},
            "faceAnnotations": [
              {}
            ],
            "fullTextAnnotation": {},
            "imagePropertiesAnnotation": {},
            "labelAnnotations": [
              {}
            ],
            "landmarkAnnotations": [
              {}
            ],
            "localizedObjectAnnotations": [
              {}
            ],
            "logoAnnotations": [
              {}
            ],
            "safeSearchAnnotation": {},
            "textAnnotations": [
              {}
            ],
            "webDetection": {}
          }
        ],
        "totalPages": 1
      }
    ]
  }
}
```

### Annotate image URLs

Apply the same detection features to a batch of image URLs.

**Inputs**

- Image URLs (`image_urls`, list, required): Up to 16 HTTPS image URLs or Cloud Storage URIs.
- Features (`features`, list, required): Choose the types of annotations to return. One or more of: `FACE_DETECTION` (Face detection), `LANDMARK_DETECTION` (Landmark detection), `LOGO_DETECTION` (Logo detection), `LABEL_DETECTION` (Label detection), `TEXT_DETECTION` (Text detection), `DOCUMENT_TEXT_DETECTION` (Document text detection), `SAFE_SEARCH_DETECTION` (Safe search detection), `IMAGE_PROPERTIES` (Image properties), `CROP_HINTS` (Crop hints), `WEB_DETECTION` (Web detection), `OBJECT_LOCALIZATION` (Object localization).
- Language hints (`language_hints`, list): Language codes to help text recognition.
- Max results (`max_results`, number): Maximum results per supported annotation type. At least 1.

**Outputs**

- `data` (object): The response from Google Cloud Vision.

**Example output**

```json
{
  "data": {
    "responses": [
      {
        "cropHintsAnnotation": {},
        "error": {},
        "faceAnnotations": [
          {}
        ],
        "fullTextAnnotation": {},
        "imagePropertiesAnnotation": {},
        "labelAnnotations": [
          {}
        ],
        "landmarkAnnotations": [
          {}
        ],
        "localizedObjectAnnotations": [
          {}
        ],
        "logoAnnotations": [
          {}
        ],
        "safeSearchAnnotation": {},
        "textAnnotations": [
          {}
        ],
        "webDetection": {}
      }
    ]
  }
}
```

### Get extraction status

Read progress for an asynchronous Vision job.

**Inputs**

- Operation ID (`operation_id`, text, required): The full operation name from the extraction step or its ID.

**Outputs**

- `data` (object): The response from Google Cloud Vision.

**Example output**

```json
{
  "data": {
    "done": true,
    "error": {},
    "metadata": {},
    "name": "example",
    "response": {}
  }
}
```

### Start document text extraction

Start extracting text and write the output to Cloud Storage.

**Inputs**

- Source (`source`, text, required): The gs:// URI of the input file.
- Mime type (`mime_type`, text, required): The file format. One of: `application/pdf`, `image/tiff`.
- Destination (`destination`, text, required): The gs:// folder for the output JSON files.

**Outputs**

- `data` (object): The response from Google Cloud Vision.

**Example output**

```json
{
  "data": {
    "done": true,
    "error": {},
    "metadata": {},
    "name": "example",
    "response": {}
  }
}
```
