PanoSAM#

SAM3 segmentation for equirectangular panorama images. Handles perspective projection, coordinate conversion, and mask deduplication.

Installation#

# Lightweight (bring your own engine)
pip install "panosam @ git+https://github.com/yz3440/panosam.git"

# With SAM3
pip install "panosam[sam3]"

# With visualization
pip install "panosam[full] @ git+https://github.com/yz3440/panosam.git"

SAM3 requires HuggingFace authentication. Accept the license at huggingface.co/facebook/sam3, then:

huggingface-cli login

Quick Start#

import panosam as ps
from panosam.engines.sam3 import SAM3Engine

engine = SAM3Engine()
client = ps.PanoSAM(engine=engine)
result = client.segment("panorama.jpg", prompt="car")
result.save_json("results.panosam.json")

Demo#

The preview tool visualizes segmentation results on an interactive 3D sphere.

cd preview && python -m http.server

Open http://localhost:8000 and drag in the JSON result file and panorama image.

Next#