Downloads · 30 days
84
27% of all-time downloads
Realcat/skywater_seg
skywater_seg is a image segmentation model from Realcat. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for segmentation-models-pytorch. The card lists the license as mit.
SegFormer MiT-B2 (24.7M params) fine-tuned on ADE20K for sky, water, and person segmentation. Designed to pre-filter images for Structure from Motion (SfM) and image matching pipelines — mask out sky, water, and perso…
Downloads · 30 days
84
27% of all-time downloads
All-time downloads
313
Public
Parameters
24.7M
606 MB on disk
Likes
0
Public
Click a slice to open those files.
.pth297 MB · 54%
From the Hugging Face model README
SegFormer MiT-B2 (24.7M params) fine-tuned on ADE20K for sky, water, and person segmentation. Designed to pre-filter images for Structure from Motion (SfM) and image matching pipelines — mask out sky, water, and person regions to eliminate their interference.
ADE20K filtered validation set (1,111 images, 384×384 input):
| Class | IoU | Dice | Precision | Recall |
|---|---|---|---|---|
| Background | 96.6% | 98.3% | 98.9% | 97.6% |
| Sky | 92.1% | 95.9% | 93.3% | 98.6% |
| Water | 79.4% | 88.5% | 89.9% | 87.2% |
| Person | 77.8% | 87.5% | 85.0% | 90.1% |
| Foreground mIoU | 88.1% | — | — | — |
| Overall mIoU | 94.6% | — | — | — |
| Pixel Accuracy | 97.2% | — | — | — |
| Backend | Latency | Platforms |
|---|---|---|
| ONNX FP16 GPU | 13.3 ms | NVIDIA CUDA |
| ONNX FP32 GPU | 15.4 ms | NVIDIA CUDA |
| PyTorch FP32 | 24.1 ms | CUDA / MPS / CPU |
| ONNX CoreML | ~3 ms | Apple Silicon (macOS) |
| ONNX FP32 CPU | 188 ms | Any |
All ONNX variants produce pixel-identical results to PyTorch. Verified on 50 validation images (12M pixels): only 0.003% pixel difference from FP16 rounding.
<p align="center"> <img src="sample_grid.png" width="100%" alt="Sample predictions"> </p>| File | Format | Size | Description |
|---|---|---|---|
skywater_segformer_b2.pth | PyTorch | 284 MB | Full checkpoint (model + optimizer + scheduler) |
skywater_segformer_b2_fp32.onnx | ONNX FP32 | 95 MB | FP32 — CPU, CUDA, CoreML, TensorRT |
skywater_segformer_b2_fp16.onnx | ONNX FP16 | 48 MB | FP16 — CUDA, CoreML, TensorRT (1.8× faster) |
config.yaml | YAML | 2 KB | Training config for reproducibility |
data/train.txt | Text | 11,086 lines | Training split |
data/val.txt | Text | 1,111 lines | Validation split |
pip install skywater-seg
from skywater_seg import SkyWaterSegModel
import torch
model = SkyWaterSegModel.from_pretrained("Realcat/skywater_seg")
model.eval()
img = ... # (H, W, 3) RGB, normalized, resized to 384×384
with torch.no_grad():
logits = model(img) # (1, 4, H, W)
from skywater_seg import ONNXRuntimeInference
# NVIDIA GPU
infer = ONNXRuntimeInference("skywater_segformer_b2_fp16.onnx", provider="cuda")
# Apple Silicon
infer = ONNXRuntimeInference("skywater_segformer_b2_fp16.onnx", provider="coreml")
# CPU
infer = ONNXRuntimeInference("skywater_segformer_b2_fp32.onnx", provider="cpu")
result = infer.predict("image.jpg")
pip install skywater-seg
# PyTorch
skywater-infer --checkpoint skywater_segformer_b2.pth --input image.jpg
# ONNX
skywater-infer --onnx skywater_segformer_b2_fp16.onnx --input image.jpg
infer = ONNXRuntimeInference("skywater_segformer_b2_fp16.onnx", provider="cuda")
results = infer.predict_batch(["img1.jpg", "img2.jpg", "img3.jpg"], batch_size=4)
for r in results:
print(r["mask"].shape, r["sky_mask"].mean())
ADEChallengeData2016 subset)config.yaml paths to your ADE20K locationdata/uv run python train.py --config config.yamlSee data/README.md for the class mapping and dataset layout.
Code & full pipeline: github.com/Vincentqyw/skywater
@misc{qin2026skywater,
author = {Vincent Qin},
title = {SkyWater-Seg: Sky, Water, and Person Segmentation
for Structure from Motion},
year = {2026},
howpublished = {\url{https://github.com/Vincentqyw/skywater}},
}