<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/vision/image_classifier.py#L48-L127) |

Class that performs classification on images.

    tflite_support.task.vision.ImageClassifier(
        options: https://developers.google.com/edge/api/tflite/python/tflite_support/task/vision/ImageClassifierOptions,
        classifier: _CppImageClassifier
    ) -> None

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `options` | <br /> <br /> |

<br />

## Methods

### `classify`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/vision/image_classifier.py#L95-L123)

    classify(
        image: https://developers.google.com/edge/api/tflite/python/tflite_support/task/vision/TensorImage,
        bounding_box: Optional[https://developers.google.com/edge/api/tflite/python/tflite_support/task/processor/BoundingBox] = None
    ) -> https://developers.google.com/edge/api/tflite/python/tflite_support/task/processor/ClassificationResult

Performs classification on the provided TensorImage.

<br />

<br />

<br />

| Args ||
|---|---|
| `image` | Tensor image, used to extract the feature vectors. |
| `bounding_box` | Bounding box, optional. If set, performed feature vector extraction only on the provided region of interest. Note that the region of interest is not clamped, so this method will fail if the region is out of bounds of the input image. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| classification result. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If any of the input arguments is invalid. |
| `RuntimeError` | If failed to run classification. |

<br />

### `create_from_file`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/vision/image_classifier.py#L58-L74)

    @classmethod
    create_from_file(
        file_path: str
    ) -> 'ImageClassifier'

Creates the `ImageClassifier` object from a TensorFlow Lite model.

<br />

<br />

<br />

| Args ||
|---|---|
| `file_path` | Path to the model. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `ImageClassifier` object that's created from the model file. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If failed to create `ImageClassifier` object from the provided file such as invalid file. |
| `RuntimeError` | If other types of error occurred. |

<br />

### `create_from_options`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/vision/image_classifier.py#L76-L93)

    @classmethod
    create_from_options(
        options: https://developers.google.com/edge/api/tflite/python/tflite_support/task/vision/ImageClassifierOptions
    ) -> 'ImageClassifier'

Creates the `ImageClassifier` object from image classifier options.

<br />

<br />

<br />

| Args ||
|---|---|
| `options` | Options for the image classifier task. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `ImageClassifier` object that's created from `options`. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If failed to create `ImageClassifier` object from `ImageClassifierOptions` such as missing the model. |
| `RuntimeError` | If other types of error occurred. |

<br />