# Python image classification libraries

Python image classification libraries assign one or more labels to an image with a trained neural network. Most start from a model pretrained on a large dataset and fine-tune it on a smaller set of labeled images. These libraries let apps and AI agents sort photos and documents by what they show.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Transformers](#transformers) | 120.5M | 169.2K | Nov 2026 | Apache-2.0 |
| [TorchVision](#torchvision) | 18.1M | 18.0K | Oct 2026 | BSD-3-Clause |
| [Keras](#keras) | 12.1M | 64.4K | Jul 2026 | Apache-2.0 |
| [timm](#timm) | 11.8M | 37.3K | Nov 2026 | Apache-2.0 |
| [Ultralytics](#ultralytics) | 5.1M | 63.6K | Nov 2026 | AGPL-3.0 |
| [OpenCLIP](#open-clip-torch) | 2.2M | 14.3K | Nov 2026 | MIT |
| [TF-Keras](#tf-keras) | 2.1M | 88 | Mar 2026 | Apache-2.0 |
| [vit-pytorch](#vit-pytorch) | 552.8K | 25.6K | Nov 2026 | MIT |

Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Transformers](#transformers) has the most monthly downloads in this comparison, at 120.5M, a count that covers every model task in the library.

## Capabilities

| Library | Pretrained classifier factory | TensorFlow training |
| --- | --- | --- |
| [Transformers](#transformers) | Yes | No |
| [TorchVision](#torchvision) | Yes | No |
| [Keras](#keras) | Yes | Yes |
| [timm](#timm) | Yes | No |
| [Ultralytics](#ultralytics) | Yes | No |
| [OpenCLIP](#open-clip-torch) | Yes | No |
| [TF-Keras](#tf-keras) | Yes | Yes |
| [vit-pytorch](#vit-pytorch) | No | No |

## Libraries

### Transformers

[GitHub](https://github.com/huggingface/transformers) · [PyPI](https://pypi.org/project/transformers) · [Docs](https://huggingface.co/docs/transformers/en/tasks/image_classification)

Classifies images with pretrained models and configurable image processors.

- Downloads / mo: 120.5M
- Stars: 169.2K
- Last release: 5.23.0
- License: Apache-2.0
- Capabilities: [From the Transformers docs](https://huggingface.co/docs/transformers/en/tasks/image_classification)

**Strengths**

- **Scores new labels without training.** Use zero-shot-image-classification with a compatible image-text checkpoint.
- **Chooses image preprocessing backends.** Select torchvision or PIL with the image processor’s backend option.

**Watch out for**

- **ViT can rescale inputs twice.** Set do_rescale=False for images already between zero and one.
- **PIL preprocessing is CPU-only.** Select the torchvision backend when preprocessing must run on a GPU.

```sh
pip install "transformers[torch]" pillow
```

**docling-project/docling** (70.8K stars)

[docling-project/docling](https://github.com/docling-project/docling) 

```python
def predict_batch(
    self, input_batch: List[ImageClassificationEngineInput]
) -> List[ImageClassificationEngineOutput]:
    """Run inference on a batch of inputs."""
    import torch

    if not input_batch:
        return []
    if self._model is None or self._processor is None or self._device is None:
        raise RuntimeError("Engine not initialized. Call initialize() first.")

    images = [item.image.convert("RGB") for item in input_batch]
    inputs = self._processor(images=images, return_tensors="pt").to(
        self._device, self._model.dtype
    )

    with torch.inference_mode():
        outputs = self._model(**inputs)  # type: ignore[operator]
        probs_batch = torch.softmax(outputs.logits, dim=-1)

    batch_outputs: List[ImageClassificationEngineOutput] = []
    for input_item, probs_vector in zip(input_batch, probs_batch):
        # Use topk for efficiency when top_k is specified
        if self.options.top_k is not None:
            k = min(self.options.top_k, len(probs_vector))
            scores, labels = torch.topk(probs_vector, k=k)
        else:
            scores, labels = torch.sort(probs_vector, descending=True)

        batch_outputs.append(
            self._build_output(
                input_item=input_item,
                labels=labels.tolist(),
                scores=scores.tolist(),
            )
        )

    return batch_outputs

```

[docling/models/inference_engines/image_classification/transformers_engine.py](https://github.com/docling-project/docling/blob/8f351cbf7b09dcbf23fe0162ab49a90ec531e421/docling/models/inference_engines/image_classification/transformers_engine.py#L174-L211) · [More projects using Transformers →](https://dashboard.exa.ai/playground/search?q=Python%20applications%20using%20transformers%20for%20whole-image%20classification%20with%20real%20native%20pretrained%20models%2C%20matching%20input%20transforms%20and%20class%20labels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
from transformers import pipeline

classifier = pipeline("image-classification", model="google/vit-base-patch16-224")
print(classifier("image.jpg"))

```

From [vit.md](https://huggingface.co/docs/transformers/en/tasks/image_classification)

### TorchVision

[GitHub](https://github.com/pytorch/vision) · [PyPI](https://pypi.org/project/torchvision) · [Docs](https://docs.pytorch.org/vision/stable/models.html)

Provides image-classification models, pretrained weights, and image transforms.

- Downloads / mo: 18.1M
- Stars: 18.0K
- Last release: 0.29.2
- License: BSD-3-Clause
- Capabilities: [From the TorchVision docs](https://docs.pytorch.org/vision/stable/models.html)

**Strengths**

- **Bundles preprocessing with each weight.** Use the weight transforms to match the model’s expected input.
- **Provides label names with weights.** Read the predicted class name from the weight metadata.

**Watch out for**

- **Input transforms vary between weights.** Match preprocessing to the exact model and weight version.
- **Training and inference modes differ.** Call eval before classifying with a pretrained model.

```sh
pip install torch torchvision pillow
```

**ultralytics/ultralytics** (63.6K stars)

[ultralytics/ultralytics](https://github.com/ultralytics/ultralytics) 

```python
def classify_transforms(
    size: tuple[int, int] | int = 224,
    mean: tuple[float, float, float] = DEFAULT_MEAN,
    std: tuple[float, float, float] = DEFAULT_STD,
    interpolation: str = "BILINEAR",
    crop_fraction: float | None = None,
):
    """Create a composition of image transforms for classification tasks.

    This function generates a sequence of torchvision transforms suitable for preprocessing images for classification
    models during evaluation or inference. The transforms include resizing, center cropping, conversion to tensor, and
    normalization.

    Args:
        size (tuple[int, int] | int): The target size for the transformed image. If an int, it defines the shortest
            edge. If a tuple, it defines (height, width).
        mean (tuple[float, float, float]): Mean values for each RGB channel used in normalization.
        std (tuple[float, float, float]): Standard deviation values for each RGB channel used in normalization.
        interpolation (str): Interpolation method of either 'NEAREST', 'BILINEAR' or 'BICUBIC'.
        crop_fraction (float | None): Deprecated, will be removed in a future version.

    Returns:
        (torchvision.transforms.Compose): A composition of torchvision transforms.

    Examples:
        >>> from PIL import Image
        >>> from ultralytics.data.augment import classify_transforms
        >>> transforms = classify_transforms(size=224)
        >>> img = Image.open("path/to/image.jpg")
        >>> transformed_img = transforms(img)
    """
    import torchvision.transforms as T  # scope for faster 'import ultralytics'

    scale_size = size if isinstance(size, (tuple, list)) and len(size) == 2 else (size, size)

    if crop_fraction:
        deprecation_warn("crop_fraction")

    # Square target uses the scalar shortest-edge mode (preserves aspect); non-square resizes to the exact (h, w).
    resize = scale_size[0] if scale_size[0] == scale_size[1] else scale_size
    tfl = [
        T.Resize(resize, interpolation=getattr(T.InterpolationMode, interpolation)),
        T.CenterCrop(size),
        T.ToTensor(),
        T.Normalize(mean=torch.tensor(mean), std=torch.tensor(std)),
    ]
    return T.Compose(tfl)

```

[ultralytics/data/augment.py](https://github.com/ultralytics/ultralytics/blob/4d254d8141e49dd85009e1ec7657ab3c4ee8c150/ultralytics/data/augment.py#L2920-L2966) · [More projects using TorchVision →](https://dashboard.exa.ai/playground/search?q=Python%20applications%20using%20torchvision%20for%20whole-image%20classification%20with%20real%20native%20pretrained%20models%2C%20matching%20input%20transforms%20and%20class%20labels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
from PIL import Image
from torchvision.models import resnet50, ResNet50_Weights

weights = ResNet50_Weights.DEFAULT
model = resnet50(weights=weights).eval()
image = weights.transforms()(Image.open("image.jpg").convert("RGB")).unsqueeze(0)
print(model(image).argmax(1))

```

From [models.rst](https://docs.pytorch.org/vision/stable/models.html)

### Keras

[GitHub](https://github.com/keras-team/keras) · [PyPI](https://pypi.org/project/keras) · [Docs](https://keras.io/api/applications/)

Provides Keras with multiple backends.

- Downloads / mo: 12.1M
- Stars: 64.4K
- Last release: 3.15.1
- License: Apache-2.0
- Capabilities: [From the Keras docs](https://keras.io/api/applications/)

```sh
pip install keras tensorflow pillow numpy
```

**keras-team/keras-io** (3.0K stars)

[keras-team/keras-io](https://github.com/keras-team/keras-io) 

```python
def make_model(input_shape, num_classes):
    inputs = keras.Input(shape=input_shape)

    # Entry block
    x = layers.Rescaling(1.0 / 255)(inputs)
    x = layers.Conv2D(128, 3, strides=2, padding="same")(x)
    x = layers.BatchNormalization()(x)
    x = layers.Activation("relu")(x)

    previous_block_activation = x  # Set aside residual

    for size in [256, 512, 728]:
        x = layers.Activation("relu")(x)
        x = layers.SeparableConv2D(size, 3, padding="same")(x)
        x = layers.BatchNormalization()(x)

        x = layers.Activation("relu")(x)
        x = layers.SeparableConv2D(size, 3, padding="same")(x)
        x = layers.BatchNormalization()(x)

        x = layers.MaxPooling2D(3, strides=2, padding="same")(x)

        # Project residual
        residual = layers.Conv2D(size, 1, strides=2, padding="same")(
            previous_block_activation
        )
        x = layers.add([x, residual])  # Add back residual
        previous_block_activation = x  # Set aside next residual

    x = layers.SeparableConv2D(1024, 3, padding="same")(x)
    x = layers.BatchNormalization()(x)
    x = layers.Activation("relu")(x)

    x = layers.GlobalAveragePooling2D()(x)
    if num_classes == 2:
        units = 1
    else:
        units = num_classes

    x = layers.Dropout(0.25)(x)
    # We specify activation=None so as to return logits
    outputs = layers.Dense(units, activation=None)(x)
    return keras.Model(inputs, outputs)

```

[examples/vision/image_classification_from_scratch.py](https://github.com/keras-team/keras-io/blob/f5891b3cd4df69f6bd5a3c26ea92310f3a973626/examples/vision/image_classification_from_scratch.py#L236-L278) · [More projects using Keras →](https://dashboard.exa.ai/playground/search?q=keras%20GitHub%20projects)

**Quickstart**

```python
import keras
import numpy as np
from keras.applications.resnet50 import preprocess_input, decode_predictions

model = keras.applications.ResNet50(weights="imagenet")
image = keras.utils.load_img("image.jpg", target_size=(224, 224))
inputs = preprocess_input(np.expand_dims(keras.utils.img_to_array(image), 0))
print(decode_predictions(model.predict(inputs), top=3)[0])

```

From [index.md](https://keras.io/api/applications/)

### timm

[GitHub](https://github.com/huggingface/pytorch-image-models) · [PyPI](https://pypi.org/project/timm) · [Docs](https://huggingface.co/docs/timm/en/quickstart)

Loads pretrained PyTorch image classifiers and supplies their data transforms.

- Downloads / mo: 11.8M
- Stars: 37.3K
- Last release: 1.0.31
- License: Apache-2.0
- Capabilities: [From the timm docs](https://huggingface.co/docs/timm/en/quickstart)

**Strengths**

- **Selects pretrained models by name.** Use create_model to load a named classifier with pretrained weights.
- **Replaces the classifier for finetuning.** Set num_classes when adapting a pretrained model to new labels.

**Watch out for**

- **New models start in training.** Call eval before using the model for inference.
- **Custom datasets need training code.** Write a PyTorch training loop or adapt timm’s training script.

```sh
pip install timm pillow
```

**huggingface/api-inference-community** (174 stars)

[huggingface/api-inference-community](https://github.com/huggingface/api-inference-community) 

```python
def __call__(self, inputs: Image.Image) -> List[Dict[str, Any]]:
    """
    Args:
        inputs (:obj:`PIL.Image`):
            The raw image representation as PIL.
            No transformation made whatsoever from the input. Make all necessary transformations here.
    Return:
        A :obj:`list`:. The list contains items that are dicts should be liked {"label": "XXX", "score": 0.82}
            It is preferred if the returned list is in decreasing `score` order
    """
    im = inputs.convert("RGB")
    inputs = self.transform(im).unsqueeze(0)

    with torch.no_grad():
        out = self.model(inputs)

    probabilities = out.squeeze(0).softmax(dim=0)
    values, indices = torch.topk(probabilities, self.top_k)

    labels = [
        {
            "label": self.dataset_info.index_to_description(i, detailed=True),
            "score": v.item(),
        }
        for i, v in zip(indices, values)
    ]
    return labels

```

[docker_images/timm/app/pipelines/image_classification.py](https://github.com/huggingface/api-inference-community/blob/2fd0029ce344ab6cc75ead904bfce2d220b054de/docker_images/timm/app/pipelines/image_classification.py#L44-L70) · [More projects using timm →](https://dashboard.exa.ai/playground/search?q=Python%20applications%20using%20timm%20for%20whole-image%20classification%20with%20real%20native%20pretrained%20models%2C%20matching%20input%20transforms%20and%20class%20labels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import timm
from PIL import Image
from timm.data import resolve_data_config
from timm.data.transforms_factory import create_transform

model = timm.create_model("mobilenetv3_large_100", pretrained=True).eval()
transform = create_transform(**resolve_data_config(model.pretrained_cfg))
image = transform(Image.open("image.jpg").convert("RGB")).unsqueeze(0)
print(model(image).argmax(1))

```

From [README.md](https://huggingface.co/docs/timm/en/quickstart)

### Ultralytics

[GitHub](https://github.com/ultralytics/ultralytics) · [PyPI](https://pypi.org/project/ultralytics) · [Docs](https://docs.ultralytics.com/tasks/classify/)

Runs YOLO models for detection, segmentation, classification, pose estimation, and tracking.

- Downloads / mo: 5.1M
- Stars: 63.6K
- Last release: 8.4.215
- License: AGPL-3.0
- Capabilities: [From the Ultralytics docs](https://docs.ultralytics.com/tasks/classify/)

```sh
pip install ultralytics
```

**HumanSignal/label-studio-ml-backend** (1.1K stars)

[HumanSignal/label-studio-ml-backend](https://github.com/HumanSignal/label-studio-ml-backend) 

```python
def predict_regions(self, path) -> List[Dict]:
    results = self.model.predict(path)
    self.debug_plot(results[0].plot())
    return self.create_choices(results, path)

```

[label_studio_ml/examples/yolo/control_models/choices.py](https://github.com/HumanSignal/label-studio-ml-backend/blob/5d160d6b736a1fc8faecb10b6ffe86f1fc228f44/label_studio_ml/examples/yolo/control_models/choices.py#L27-L30) · [More projects using Ultralytics →](https://dashboard.exa.ai/playground/search?q=ultralytics%20GitHub%20projects)

**Quickstart**

```python
from ultralytics import YOLO

model = YOLO("yolo26n-cls.pt")
print(model("image.jpg")[0].probs.top1)

```

From [classify.md](https://docs.ultralytics.com/tasks/classify/)

### OpenCLIP

[GitHub](https://github.com/mlfoundations/open_clip) · [PyPI](https://pypi.org/project/open-clip-torch)

Reproduces contrastive language-image pretraining (CLIP) in the open.

- Downloads / mo: 2.2M
- Stars: 14.3K
- Last release: 4.2.2
- License: MIT
- Capabilities: [From the OpenCLIP docs](https://github.com/mlfoundations/open_clip)

```sh
pip install open-clip-torch pillow
```

**LAION-AI/CLIP_benchmark** (819 stars)

[LAION-AI/CLIP_benchmark](https://github.com/LAION-AI/CLIP_benchmark) 

```python
def run_classification(model, classifier, dataloader, device, amp=True):
    """
    Run zero-shot classifcation

    model: torch.nn.Module
        CLIP-like model with `encode_image` and `encode_text`

    classifier: torch.Tensor
        obtained from the function `zero_shot_classifier`

    dataloader: torch.utils.data.Dataloader 

    Returns
    -------
    (pred, true)  where
        - pred (N, C) are the logits
        - true (N,) are the actual classes
    """
    pred = []
    true = []
    nb = 0
    with torch.no_grad():
        for images, target in tqdm(dataloader):
            images = images.to(device)
            target = target.to(device)

            with torch.autocast(device, enabled=amp):
                # predict
                image_features = model.encode_image(images)
                image_features = F.normalize(image_features, dim=-1)
                logits = 100. * image_features @ classifier

            true.append(target.cpu())
            pred.append(logits.float().cpu())

    pred = torch.cat(pred)
    true = torch.cat(true)
    return pred, true

```

[clip_benchmark/metrics/zeroshot_classification.py](https://github.com/LAION-AI/CLIP_benchmark/blob/574461d2e9c566d6282bd4217f1eeb1ad7ead47f/clip_benchmark/metrics/zeroshot_classification.py#L85-L122) · [More projects using OpenCLIP →](https://dashboard.exa.ai/playground/search?q=open-clip-torch%20GitHub%20projects)

**Quickstart**

```python
import torch
from PIL import Image
import open_clip

model, _, preprocess = open_clip.create_model_and_transforms("ViT-B-32", pretrained="laion2b_s34b_b79k")
model.eval()
text = open_clip.get_tokenizer("ViT-B-32")(["a dog", "a cat"])
image = preprocess(Image.open("image.jpg")).unsqueeze(0)
with torch.no_grad():
    print(model.get_logits(image, text)[0].softmax(-1))

```

From [README.md](https://github.com/mlfoundations/open_clip)

### TF-Keras

[GitHub](https://github.com/keras-team/tf-keras) · [PyPI](https://pypi.org/project/tf-keras)

Provides deep learning for humans.

- Downloads / mo: 2.1M
- Stars: 88
- Last release: 2.21.0
- License: Apache-2.0
- Capabilities: [From the TF-Keras docs](https://github.com/keras-team/tf-keras)

```sh
pip install "tf-keras==2.21.0" pillow
```

**tensorflow/probability** (4.4K stars)

[tensorflow/probability](https://github.com/tensorflow/probability) 

```python
def _vggconv_block(x, filters, kernel, stride, kernel_posterior_fn):
  """Network block for VGG."""
  out = tfp.layers.Convolution2DFlipout(
      filters,
      kernel,
      padding='same',
      kernel_posterior_fn=kernel_posterior_fn)(x)
  out = tf_keras.layers.BatchNormalization()(out)
  out = tf_keras.layers.Activation('relu')(out)

  out = tfp.layers.Convolution2DFlipout(
      filters,
      kernel,
      padding='same',
      kernel_posterior_fn=kernel_posterior_fn)(out)
  out = tf_keras.layers.BatchNormalization()(out)
  out = tf_keras.layers.Activation('relu')(out)

  out = tf_keras.layers.MaxPooling2D(
      pool_size=(2, 2), strides=stride)(out)
  return out

```

[tensorflow_probability/examples/models/bayesian_vgg.py](https://github.com/tensorflow/probability/blob/df8c454f10495cc8584d0540e202911b61bce312/tensorflow_probability/examples/models/bayesian_vgg.py#L82-L102) · [More projects using TF-Keras →](https://dashboard.exa.ai/playground/search?q=tf-keras%20GitHub%20projects)

**Quickstart**

```python
import tf_keras as keras
from tf_keras.applications.resnet50 import preprocess_input, decode_predictions

model = keras.applications.ResNet50(weights="imagenet")
image = keras.utils.load_img("image.jpg", target_size=(224, 224))
inputs = preprocess_input(keras.utils.img_to_array(image)[None, ...])
print(decode_predictions(model.predict(inputs), top=3)[0])

```

From [resnet.py](https://github.com/keras-team/tf-keras/blob/v2.21.0/tf_keras/applications/resnet.py)

### vit-pytorch

[GitHub](https://github.com/lucidrains/vit-pytorch) · [PyPI](https://pypi.org/project/vit-pytorch)

Implements the Vision Transformer (ViT) in PyTorch.

- Downloads / mo: 552.8K
- Stars: 25.6K
- Last release: 1.26.14
- License: MIT
- Capabilities: [From the vit-pytorch docs](https://github.com/lucidrains/vit-pytorch)

```sh
pip install vit-pytorch
```

**allenai/satlas** (291 stars)

[allenai/satlas](https://github.com/allenai/satlas) 

```python
def forward(self, image_list, targets=None, selected_task=None):
    images = torch.stack(image_list, dim=0)
    logits = self.backbone(images)

    outputs = []
    losses = []

    for task_idx, task in enumerate(self.tasks):
        cur_logits = logits[:, self.task_output_offsets[task_idx]:self.task_output_offsets[task_idx+1]]

        if task['type'] == 'classification':
            cur_outputs = torch.nn.functional.softmax(cur_logits, dim=1)

            if targets is not None:
                cur_valid = torch.stack([target[task_idx]['valid'] for target in targets], dim=0)
                cur_targets = torch.cat([target[task_idx]['label'] for target in targets], dim=0).to(torch.long)
                loss = torch.nn.functional.cross_entropy(cur_logits, cur_targets, reduction='none') * cur_valid
                losses.append(loss.mean())
        elif task['type'] == 'multi-label-classification':
            cur_outputs = torch.sigmoid(cur_logits)

            if targets is not None:
                cur_valid = torch.stack([target[task_idx]['valid'] for target in targets], dim=0)
                cur_targets = torch.stack([target[task_idx]['labels'] for target in targets], dim=0).to(torch.float32)
                loss = torch.nn.functional.binary_cross_entropy_with_logits(cur_logits, cur_targets.squeeze(), reduction='none') * cur_valid
                losses.append(loss.mean())

        outputs.append(cur_outputs)

    if len(losses) > 0:
        losses = torch.stack(losses, dim=0)
    else:
        losses = torch.tensor(0, device=images.device, dtype=torch.float32)

    return outputs, losses

```

[satlas/model/classify.py](https://github.com/allenai/satlas/blob/c8b9aa5d4acdd3e4f58eb7cbb28ac18bb12c985f/satlas/model/classify.py#L93-L127) · [More projects using vit-pytorch →](https://dashboard.exa.ai/playground/search?q=vit-pytorch%20GitHub%20projects)

**Quickstart**

```python
import torch
from vit_pytorch import ViT

model = ViT(image_size=256, patch_size=32, num_classes=1000, dim=1024, depth=6, heads=16, mlp_dim=2048)
print(model(torch.randn(1, 3, 256, 256)).shape)

```

From [README.md](https://github.com/lucidrains/vit-pytorch)

## FAQ

### Which Python image classification library should I use?

[timm](#timm) and [TorchVision](#torchvision) suit PyTorch projects that start from pretrained image classifiers. [Transformers](#transformers) suits checkpoints from the Hugging Face Hub. [Ultralytics](#ultralytics) suits YOLO training and export with little setup.

### What is timm?

[timm](#timm) is a large registry of PyTorch image models and pretrained weights. Each model comes with its own preprocessing and classifier metadata.

### What is TorchVision?

[TorchVision](#torchvision) is the PyTorch library of image models, pretrained weights, and image transforms.

### What is OpenCLIP?

[OpenCLIP](#open-clip-torch) is an open reproduction of CLIP that embeds images and text in one space. It classifies images zero-shot by comparing them to a list of candidate labels.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best Python image classification libraries TorchVision timm Transformers TensorFlow code examples pretrained classifiers preprocessing custom labels",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
