File size: 790 Bytes
5c64a8f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/usr/bin/env python3
"""Simple OV-3 test. Run: conda activate rsgen && python test_ov3_simple.py
Requires: sam3, pycocotools (pip install pycocotools if missing)."""
from pathlib import Path
from PIL import Image
from pipeline import SegEarthPipeline
if __name__ == "__main__":
repo = Path(__file__).resolve().parent
img_path = repo / "demo_YESeg-OPT-SAR" / "sar.png"
if not img_path.exists():
img_path = repo / "demo.png"
if not img_path.exists():
print("No demo image found")
exit(1)
print("Loading OV-3...")
pipe = SegEarthPipeline(variant="OV-3", device="cuda")
print("Running inference...")
img = Image.open(img_path).convert("RGB")
pred = pipe(img)
print(f"OK shape={pred.shape} classes={pred.unique().tolist()}")
|