Wave Regression
This repository publishes the latest trained model (v23) with the fast-v2.2 preprocessing pipeline: 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 release: v23 (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 | ef11d781dc81fafa30864d408375c9352178f3ea6834a0c32410b99be242bc93 |
| Segmenter | segformer-b0-step1-448.onnx |
| Segmenter SHA-256 | 96410800203e3f19b7dab26980ea6413f6f9369bb868e23bfa7f14eca6681fda |
| Architecture | Frozen ImageNet EfficientNet-B0 backbone with a trained sigmoid regression head |
| Training run | v23; selected epoch 12 |
| Split snapshot | 20261123T152827864312Z; 300 training / 64 validation / 64 test photos |
| Validation MAE / RMSE | 0.0938 / 0.1165 |
| Held-out test | Not evaluated for v23 |
Detailed metrics, artifact hashes, and the exact preprocessing contract are in config.json, training-manifest.json, and preprocessing.json. The source PyTorch checkpoint is wave-regression-efficientnet_b0-v23-best-val-mae-epoch=11-val_mae=0.0938.ckpt. The ONNX export was checked against this checkpoint on eight validation images with batch sizes 1 and 8 (maximum absolute score difference 0.00000218). Validation results across different split snapshots are not directly comparable.
The earlier v19 PyTorch checkpoint and its metadata remain available as legacy artifacts (model.ckpt, legacy-v19-config.json). The bundled inference.py, model.py, and preprocessing.py are legacy v19 helpers; raw-photo inference for v23 requires the fast-v2.2 runtime described below. This Hub release does not change the model selected in the development repository.
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
- 57