# Cloud Vision V1 Client - Class EntityAnnotation (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class EntityAnnotation.

Set of detected entity features.

Generated from protobuf message `google.cloud.vision.v1.EntityAnnotation`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ mid` | `string` Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). |
| `↳ locale` | `string` The language code for the locale in which the entity textual `description` is expressed. |
| `↳ description` | `string` Entity textual description, expressed in its `locale` language. |
| `↳ score` | `float` Overall score of the result. Range \[0, 1\]. |
| `↳ confidence` | `float` **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range \[0, 1\]. |
| `↳ topicality` | `float` The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range \[0, 1\]. |
| `↳ bounding_poly` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features. |
| `↳ locations` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.LocationInfo>` The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. |
| `↳ properties` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Property>` Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. |

### getMid

Opaque entity ID. Some IDs may be available in
[Google Knowledge Graph Search
API](https://developers.google.com/knowledge-graph/).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setMid

Opaque entity ID. Some IDs may be available in
[Google Knowledge Graph Search
API](https://developers.google.com/knowledge-graph/).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLocale

The language code for the locale in which the entity textual
`description` is expressed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setLocale

The language code for the locale in which the entity textual
`description` is expressed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDescription

Entity textual description, expressed in its `locale` language.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDescription

Entity textual description, expressed in its `locale` language.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getScore

Overall score of the result. Range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setScore

Overall score of the result. Range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfidence

**Deprecated. Use `score` instead.**
The accuracy of the entity detection in an image.

For example, for an image in which the "Eiffel Tower" entity is detected,
this field represents the confidence that there is a tower in the query
image. Range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setConfidence

**Deprecated. Use `score` instead.**
The accuracy of the entity detection in an image.

For example, for an image in which the "Eiffel Tower" entity is detected,
this field represents the confidence that there is a tower in the query
image. Range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTopicality

The relevancy of the ICA (Image Content Annotation) label to the
image. For example, the relevancy of "tower" is likely higher to an image
containing the detected "Eiffel Tower" than to an image containing a
detected distant towering building, even though the confidence that
there is a tower in each image may be the same. Range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setTopicality

The relevancy of the ICA (Image Content Annotation) label to the
image. For example, the relevancy of "tower" is likely higher to an image
containing the detected "Eiffel Tower" than to an image containing a
detected distant towering building, even though the confidence that
there is a tower in each image may be the same. Range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBoundingPoly

Image region to which this entity belongs. Not produced
for `LABEL_DETECTION` features.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly|null` |   |

### hasBoundingPoly

### clearBoundingPoly

### setBoundingPoly

Image region to which this entity belongs. Not produced
for `LABEL_DETECTION` features.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLocations

The location information for the detected entity. Multiple
`LocationInfo` elements can be present because one location may
indicate the location of the scene in the image, and another location
may indicate the location of the place where the image was taken.

Location information is usually present for landmarks.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.LocationInfo>` |   |

### setLocations

The location information for the detected entity. Multiple
`LocationInfo` elements can be present because one location may
indicate the location of the scene in the image, and another location
may indicate the location of the place where the image was taken.

Location information is usually present for landmarks.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.LocationInfo>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProperties

Some entities may have optional user-supplied `Property` (name/value)
fields, such a score or string that qualifies the entity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Property>` |   |

### setProperties

Some entities may have optional user-supplied `Property` (name/value)
fields, such a score or string that qualifies the entity.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Property>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |