Model 20261119-231345, validation water IoU 0.996
Browse files- README.md +48 -0
- config.json +19 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: image-segmentation
|
| 4 |
+
tags:
|
| 5 |
+
- pytorch
|
| 6 |
+
- u-net
|
| 7 |
+
- swimming-pool
|
| 8 |
+
- semantic-segmentation
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# pool-segmentation: a swimming pool's water
|
| 12 |
+
|
| 13 |
+
A small U-Net (resnet18 encoder) that finds a swimming pool's **water** in video frames: a class for every
|
| 14 |
+
pixel, 0 other, 1 water (swimmers in the water, splashes and lane ropes count as water). About 25 ms per frame on a
|
| 15 |
+
MacBook. Made for swimming video analysis (dropping people outside the pool; later, finding the lanes).
|
| 16 |
+
|
| 17 |
+
Code, training and labeling tools: [github.com/Neptune-Trojans/pool-segmentation](https://github.com/Neptune-Trojans/pool-segmentation) (`pip install pool-segmentation`).
|
| 18 |
+
|
| 19 |
+
## Use
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from pool_segmentation import PoolModel, find_model
|
| 23 |
+
|
| 24 |
+
model = PoolModel.load(find_model()) # your newest training run in data/models/pool/, else this model
|
| 25 |
+
classes = model.predict(frame) # BGR frame -> class per pixel: 0 other, 1 water
|
| 26 |
+
water = model.water(frame) # the water's outline: one polygon [(x, y), ...] per piece of water
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
The package downloads this model the first time it is needed and keeps it in `~/.cache/huggingface`; when online, it
|
| 30 |
+
gets a newer one when there is one. A given version: `find_model("hub:20261119-231345")` (every version is tagged
|
| 31 |
+
with its training run).
|
| 32 |
+
|
| 33 |
+
## This version
|
| 34 |
+
|
| 35 |
+
| | |
|
| 36 |
+
|---|---|
|
| 37 |
+
| Training run | `20261119-231345` |
|
| 38 |
+
| Classes | 0 other, 1 water |
|
| 39 |
+
| Input | frames scaled to 1024×576 (the long side; shape kept) |
|
| 40 |
+
| Training | 89 hand-checked frames from 9 videos, 40 epochs |
|
| 41 |
+
| Validation | 19 frames (every 6th of each video): water IoU mean 0.996, worst 0.990 |
|
| 42 |
+
|
| 43 |
+
## Limits
|
| 44 |
+
|
| 45 |
+
Trained on frames filmed at a few pools, from the deck. Pools that look very different (another camera angle, light,
|
| 46 |
+
water color) may need some frames of their own: the package's labeling tools pick frames from your videos, let this
|
| 47 |
+
model label them, and you check them in the browser before training again. The training frames are not published:
|
| 48 |
+
they show real people.
|
config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"run": "20261119-231345",
|
| 3 |
+
"classes": [
|
| 4 |
+
"other",
|
| 5 |
+
"water"
|
| 6 |
+
],
|
| 7 |
+
"encoder": "resnet18",
|
| 8 |
+
"size": [
|
| 9 |
+
1024,
|
| 10 |
+
576
|
| 11 |
+
],
|
| 12 |
+
"created": "2026-11-19T23:19:56",
|
| 13 |
+
"epochs": 40,
|
| 14 |
+
"train_frames": 89,
|
| 15 |
+
"val_frames": 19,
|
| 16 |
+
"videos": 9,
|
| 17 |
+
"val_iou_mean": 0.9956,
|
| 18 |
+
"val_iou_min": 0.9901
|
| 19 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01654196f4f96fe4b3e2848690fa4248f850d0e49506101756171a148239801e
|
| 3 |
+
size 57375560
|