<!-- # hard line break macro for HTML -->

<a id="running-inference-classifications"></a>

# Inference for Classifications

Classification models label each sample (or frame) with a [`Classification`](../../api/fiftyone.core.labels.md#fiftyone.core.labels.Classification),
which you generate by passing a model to
[`apply_model()`](../../api/fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection.apply_model).

With a zoo model, this includes zero-shot classifiers like CLIP, which
require no training data at all.

<div style="margin:0; display:inline-block;">
    <a href="../../tutorials/zero_shot_classification.html" class="sd-btn sd-btn-primary book-a-demo" rel="noopener noreferrer" data-cta-dynamic="true">
        <div class="arrow">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="size-3">
            <path stroke="currentColor" stroke-width="1.5"
                    d="M1.458 11.995h20.125M11.52 22.063 21.584 12 11.521 1.937"
                    vector-effect="non-scaling-stroke"></path>
            </svg>  
        </div>
        <div class="text">Walk through zero-shot classification with a zoo model</div>
    </a>
</div>

For a custom model, you can either construct [`Classification`](../../api/fiftyone.core.labels.md#fiftyone.core.labels.Classification) instances
yourself in a loop, or configure a
[`TorchImageModel`](../../api/fiftyone.utils.torch.md#fiftyone.utils.torch.TorchImageModel) with a
[`ClassifierOutputProcessor`](../../api/fiftyone.utils.torch.md#fiftyone.utils.torch.ClassifierOutputProcessor)
so it works with `apply_model()` directly, as described in
[Inference with custom models](index.md#running-inference-custom).

<div style="margin:0; display:inline-block;">
    <a href="../../recipes/adding_classifications.html" class="sd-btn sd-btn-primary book-a-demo" rel="noopener noreferrer" data-cta-dynamic="true">
        <div class="arrow">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="size-3">
            <path stroke="currentColor" stroke-width="1.5"
                    d="M1.458 11.995h20.125M11.52 22.063 21.584 12 11.521 1.937"
                    vector-effect="non-scaling-stroke"></path>
            </svg>  
        </div>
        <div class="text">See the manual-loop recipe for custom classifiers</div>
    </a>
</div>
