A macOS menubar app that monitors surf conditions and crowd counts at Santa Cruz, CA.
Swell lives in your menubar and gives you a quick read on whether it's worth paddling out:
- Crowd count — downloads frames from live surf cams and runs a YOLO26n CoreML model to count surfers in the water region via tiled inference. The detector is the stock COCO-pretrained model — surfers are counted as the COCO
personclass inside a per-spot water region, not by a model trained on surf footage. Non-person classes a cam frame is full of (birds, boats) are dropped by the class filter - Detector self-test — a bundled reference frame of a packed lineup (
Resources/bondi-lineup.jpg), run through the same detector in the cam viewer, so "is the model finding people at all?" is answerable without a cam. Needed because acount=0on these cams is usually correct, not a failure: every lineup person they show is 6–17 px tall and the model's floor is ~22 px - Swell — wave height (ft) and period (s) from the NDBC 46042 buoy off Monterey
- Tide — current tide height and direction from NOAA CO-OPS
- Wind — speed and offshore/onshore classification from NWS
- Trend chips — shows whether conditions are improving or deteriorating over recent samples
- Daylight gating — only samples during daylight hours via a solar clock
- History — stores samples in a local SQLite database (GRDB) for trend analysis
- Cam viewer — live feed window with detection overlay; interactive polygon editor for tuning each spot's water region
- Launch at login — registers with
SMAppService
| Layer | Technology |
|---|---|
| UI | SwiftUI MenuBarExtra |
| Computer Vision | Ultralytics YOLO26n (stock COCO) via CoreML (SurferYOLO.mlpackage), exported with the NMS-free one-to-one head |
| Surf data | NDBC buoy · NOAA CO-OPS · NWS hourly |
| Video | HLS stream · snapshot · YouTube Live (public thumbnail endpoint) |
| Storage | GRDB (SQLite) |
| Language | Swift 5.9 mode |
| Platform | macOS 14+ |
Sources/
Conditions/ — NDBC / NOAA / NWS fetchers and parsers
Detection/ — SurferDetector protocol + YOLODetector CoreML implementation
Model/ — Conditions, Sample, Spot, Trend value types
Registry/ — SpotRegistry (loads spots.json)
Sampler/ — Orchestrates periodic sampling + SolarClock daylight gate
Sources/ — HLSSource, SnapshotSource, YouTubeSource frame providers
Store/ — HistoryStore (GRDB)
UI/ — MenuContentView, MenuViewModel, ConditionsStrip, SpotRow, CamViewerView
Resources/
spots.json — Spot definitions (name, cam URL, water region)
SurferYOLO.mlpackage — YOLO26n CoreML export (FP16, NMS-free head)
bondi-lineup.jpg — Detector self-test reference frame (CC BY 2.0, see License)
The Xcode project is generated by XcodeGen from
project.yml and is gitignored, so a fresh clone has nothing to open until you run:
xcodegen generateThen open Swell.xcodeproj and build the Swell scheme (Xcode 16+). The Swift package
dependencies — GRDB, MLX, MLX-LM — are fetched from their remotes on first build.
Re-run xcodegen generate whenever you add or remove a source file outside Xcode, or the
new file won't be in the target — tests in an unregenerated project are skipped silently
rather than failing.
| Spot | Source | Signal |
|---|---|---|
| Cowells | HLS | good |
| SC Wharf | HLS | low signal |
| Walton Lighthouse · Seabright | HLS | low signal |
| Pajaro Dunes | HLS (HD Relay) | ok |
| Steamer Lane | YouTube live thumbnail | good |
| Pleasure Point · The Hook · Capitola | — | locked (no public cam) |
All data sources are free and public:
| Source | Feed |
|---|---|
| NDBC buoy 46042 | ndbc.noaa.gov/data/realtime2/46042.txt |
| NOAA CO-OPS tide (station 9413450, Monterey) | api.tidesandcurrents.noaa.gov |
| NWS hourly forecast | api.weather.gov/gridpoints/MTR/97,82/forecast/hourly |
| Surf cams (HLS/snapshot) | Public HLS / MJPEG streams |
| Surf cams (YouTube) | i.ytimg.com/vi/{ID}/maxresdefault_live.jpg (no API key) |
Swell is licensed under the GNU Affero General Public License v3.0.
It bundles Resources/SurferYOLO.mlpackage, an FP16 Core ML export of
Ultralytics YOLO26n (COCO-pretrained), which is itself
AGPL-3.0 licensed. Swell is AGPL-3.0 to stay consistent with those weights. If you want
to reuse this code without the AGPL obligations, replace the model with one whose license
permits it.
It also bundles Resources/bondi-lineup.jpg, a photograph of a crowded Bondi
lineup used only as the detector's positive control (see
docs/tuning-guide.md). It is "Surfers Bondi Beach"
by Tony Hisgett, licensed
CC BY 2.0, from
Wikimedia Commons
and resized for the bundle. The credit is also shown in the app, in the cam
viewer's self-test screen.
