SamVisionEncoder

class lightning_pose.models.backbones.vit_sam.SamVisionEncoder[source]

Bases: Module

Wrapper around HuggingFace’s SAM Vision Encoder.

Methods Summary

forward(x)

Forward pass through the vision encoder.

Methods Documentation

forward(x: Tensor) Tensor[source]

Forward pass through the vision encoder.

This is mostly a copy of SamVisionEncoder.forward(), but without the neck.

Parameters:

x – Input tensor of shape (B, C, H, W)

Returns:

Encoded features

__init__(model_name: str = 'facebook/sam-vit-base', finetune_img_size: int = 1024, img_size: int = 1024)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

__new__(**kwargs)