Wave Regression
This repository publishes the current default prediction pipeline from the development project: the fast-v2.2 EfficientNet-B0 ONNX regressor and its matching water segmentation model and preprocessing contract.
The model estimates relative visual waviness of sea water in a photograph. It returns a score from 0 (calm looking) to 1 (rough looking), based on manual ratings. It does not estimate physical wave height, assign a sea-state category, or provide a safety measure.
Current default: fast-v2.2
| Item | Value |
|---|---|
| Prediction backend | ONNX Runtime CPU regressor + ONNX Runtime MIGraphX FP16 segmenter |
| Regressor | regressor-fast-v2.2.onnx |
| Regressor SHA-256 | a1a8f65500d88debe2980c900ccc55b2b8b6d46f6492d3b3ddf2a6b7ad3eb8e4 |
| Segmenter | segformer-b0-step1-448.onnx |
| Segmenter SHA-256 | 96410800203e3f19b7dab26980ea6413f6f9369bb868e23bfa7f14eca6681fda |
| Architecture | Frozen ImageNet EfficientNet-B0 backbone with a trained sigmoid regression head |
| Training run | 20261102T102000Z; selected epoch 15 |
| Validation MAE / RMSE | 0.0985 / 0.1241 |
| Held-out test MAE / RMSE | 0.1324 / 0.1788 on 46 photos |
Detailed metrics, artifact hashes, and the exact preprocessing contract are in config.json and preprocessing.json. The v21 PyTorch checkpoint is newer as a training run, but it is not the model currently selected by the default Step 7 predictor. The earlier v19 PyTorch checkpoint and its metadata remain available as legacy artifacts (model.ckpt, legacy-v19-config.json).
Raw-photo preprocessing
The regressor expects the final preprocessed 224ร224 RGB image. Do not resize a raw photo directly to 224ร224 and pass it to the regressor.
- Decode JPEG, PNG, HEIC, or HEIF input to RGB and apply EXIF orientation.
- Resize to 448ร448, normalize the segmentation tensor with ImageNet mean and standard deviation, and run the pinned SegFormer-B0 ONNX model using MIGraphX FP16.
- Project the predicted water mask to 224ร224 with OpenCV nearest-exact interpolation.
- Select a rectangle near the bottom of detected water. The selector prioritizes retention of the lowest 35% of detected water, then low projected black padding, water coverage, and a moderate crop shape. It fails if no reliable lower-water crop is available.
- Map the rectangle to the oriented source photo, crop original RGB pixels, resize proportionally with Lanczos4, center on a black 224ร224 canvas, and mask non-water pixels.
- Encode as JPEG quality 95 with 4:4:4 chroma subsampling, decode back to RGB, normalize using ImageNet mean
[0.485, 0.456, 0.406]and standard deviation[0.229, 0.224, 0.225], and run the ONNX regressor.
For exact thresholds and tie-breaking rules, see preprocessing.json. The reference implementation is in the development repository's Step 7 MIGraphX server; the prediction entry point selects this profile by default. This repo publishes the model artifacts and contract; the reference inference runtime requires the development project's Python 3.12 MIGraphX/ROCm environment.
Limitations
Labels were assigned by one person to a small collection of photos, mainly from recurring coastal viewpoints. The score is subjective and performance on other locations, angles, cameras, and lighting is unknown. Do not use this output for navigation, swimming, surfing, warnings, or physical wave-height estimation.
This project is for learning and experimentation. Licensed under MIT. The training and inference source is in the development repository.
- Downloads last month
- 55