---
title: models.sam.modules.encoders API Reference
description: Explore detailed documentation of various SAM encoder modules such as ImageEncoderViT, PromptEncoder, and more, available in Ultralytics' repository.
keywords: Ultralytics, SAM encoder, ImageEncoderViT, PromptEncoder, PositionEmbeddingRandom, Block, Attention, PatchEmbed
---

# Reference for `ultralytics/models/sam/modules/encoders.py`

!!! success "Improvements"

    This page is sourced from [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py). Have an improvement or example to add? Open a [Pull Request](https://docs.ultralytics.com/help/contributing) — thank you! 🙏

<br>

## ::: ultralytics.models.sam.modules.encoders.ImageEncoderViT

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.encoders.PromptEncoder

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.encoders.MemoryEncoder

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.encoders.ImageEncoder

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.encoders.FpnNeck

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.encoders.Hiera

<br><br>
