Instructions to use triq0/lifeguard-drone-ddt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use triq0/lifeguard-drone-ddt with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("triq0/lifeguard-drone-ddt", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
π Lifeguard Drone β DDT
Overhead swimming-pool detector for an autonomous AI lifeguard system
Predictions on held-out test frames (never seen in training), confidence β₯ 0.5.
Left: a person in distress flagged drowning. Right: a swimmer.
β οΈ Research model, not a safety device. A box, or a high
drowningscore on one frame, does not establish that someone is drowning. Distress needs temporal and contextual evidence (how long it lasts, track history, submersion time) plus human confirmation. Pool-only scope. Drowning recall is limited (0.462), and licensing is unresolved (see Licensing), so this is not cleared for commercial use.
Highlights
| Task | Detect people in and around a pool: swimming, drowning, out_of_water |
| Camera | Overhead / top-view or high-mounted pool camera |
| Test result | mAP50 0.636 Β· swimming AP50 0.845 Β· drowning AP50 0.427 (217 unseen images) |
| Data | Every drowning label was assigned by a human reviewer, never automatically |
| In the system | A 2 s mean of the drowning score triggers a pre-alert for a human operator, never an alarm on its own |
Quick start
pip install "ultralytics==8.4.218" huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("triq0/lifeguard-drone-ddt", "ddt_v2_final.pt"))
for r in model.predict("overhead_pool_frame.jpg", imgsz=640, conf=0.25):
for box in r.boxes:
print(model.names[int(box.cls)], float(box.conf), box.xyxy.tolist())
Checksum verification, video tracking and system integration: INFERENCE.md.
Ready-to-run dashboard demo with test videos:
triq0/lifeguard-drone-demo.
Model details
| Item | Value | Source |
|---|---|---|
| Architecture | Ultralytics YOLO11s DetectionModel (scale s), 9,428,953 parameters, strides 8/16/32 |
checkpoint |
| Initialisation | yolo11s.pt (Ultralytics pretrained), full fine-tuning |
checkpoint train_args |
| Framework | Ultralytics 8.4.218 | checkpoint |
| Weights | ddt_v2_final.pt, PyTorch checkpoint, FP16, 19,183,578 bytes |
file |
| SHA-256 | a6683aa3a2a0a4da5b56dc3839fd1a2cc1ee2cbb59ab023e3897f50abd1d5187 |
SHA256SUMS.txt |
| Input size | 640 Γ 640 (must match training) | checkpoint, config.yaml |
Classes
Definitions are from the project's cleaning schema and are judged from a single frame.
| Index | Name | Definition |
|---|---|---|
| 0 | swimming |
person in the water and in control: strokes, calm treading, floating with an aid, playing, walking in shallow water; in-water rescuers count here |
| 1 | drowning |
person in the water with clearly visible distress: head back or low at the surface, vertical with no effective kick, arms pressing down or flailing, face-down motionless, or submerged motionless |
| 2 | out_of_water |
person on the deck, edge, ladder, starting block or diving board, including lifeguards |
In the Lifeguard System runtime, all three classes count as "person" (person_class_ids: [0, 1, 2]).
The class-1 confidence is the distress score (distress_class_ids: [1]).
System context
This is one of two perception front ends of the Autonomous AI Lifeguard System, a student engineering project:
Pool camera β YOLO detector β ByteTrack tracking β rule-based risk engine β operator dashboard β (simulated) rescue drone.
This model covers overhead / high-mounted cameras. The side-view model is
triq0/lifeguard-drone-z5cc.
- Code, reports and configs: https://github.com/tarekmhmd/lifeguard-drone-dataset-analysis
- Training report:
docs/MODEL_TRAINING_REPORT.mdΒ§2 (source of every number on this page) - Runtime config:
configs/ai_ddt.yaml(published copy:config.yaml)
Intended use
- Research, teaching and demos of pool-safety computer vision.
- Locating people in overhead pool views, as input to a tracker and a temporal risk engine.
- An aid to a trained lifeguard or operator, who keeps responsibility for every decision.
Out of scope
- The sole or primary drowning-prevention or life-safety system.
- Alarms or rescues triggered by single-frame
drowningscores without temporal evidence and human confirmation. - Open water, beaches, lakes, the sea, underwater cameras, aerial drone footage, or side-view poolside cameras.
- Relying on the
out_of_waterclass (see Limitations). - Identifying or profiling individuals, or surveillance beyond pool safety.
- Commercial deployment while licensing is unresolved.
Training data
| Item | Verified fact |
|---|---|
| Source dataset | Roboflow Universe DrowningDetectionTracking (workspace drowningdetection-2zzxz), export v1 (2024-03-30). Its README says "Provided by a Roboflow user. License: CC BY 4.0". https://universe.roboflow.com/drowningdetection-2zzxz/drowningdetectiontracking |
| Original image sources | Unknown. The Roboflow project publishes no provenance. |
| Cleaning β ddt_v1 | Reproducible pipeline that removed duplicates, augmented copies and split leakage, with a fixed 3-class schema β 925 images and 0 drowning boxes: all possible-drowning images were quarantined, because drowning is human-only |
| Human review β ddt_v2 | Quarantined images were grouped by source clip (157 groups). The 24 largest groups (1,071 images) were reviewed by the project author, one decision per group. Filters then removed noise cut-outs, multi-person drowning images and near-duplicates. No clip appears in two splits |
| Splits (boxes swimming / drowning / out_of_water) | train 971 images (1,315 / 299 / 19) Β· valid 219 (297 / 66 / 1) Β· test 217 (313 / 52 / 0) |
| Final training set | train + valid (1,190 images) |
The dataset is not distributed here. This repository holds only the weights and documentation.
Training
Trained on Google Colab (Tesla T4). Values from the checkpoint's train_args and the training report
Β§2.5.
| Setting | Value |
|---|---|
| Epochs | 80, fixed; final = last epoch (the count is the best epoch of the earlier s640 run) |
| Batch / optimizer / lr0 / seed | 16 / AdamW / 0.001429 / 42 |
| Augmentation | mosaic 1.0, horizontal flip 0.5, vertical flip 0.5, rotation Β±10Β° (an overhead view has no fixed "up"), HSV, scale, translate, random erasing, RandAugment, mixup 0.1 |
Experiment history (same test split):
| Run | imgsz | test mAP50 | swimming AP50 | drowning AP50 | drowning recall |
|---|---|---|---|---|---|
| s640 | 640 | 0.582 | 0.695 | 0.470 | 0.438 |
| s960 (rejected) | 960 | 0.427 | 0.683 | 0.171 | 0.321 |
| final (train + valid) | 640 | 0.636 | 0.845 | 0.427 | 0.462 |
Evaluation
Held-out test split: 217 images, 365 boxes, never used for training. Ultralytics metrics; per-class P/R at the max-F1 confidence. Source: training report Β§2.5 and the training notebook's results table.
| Metric | Value |
|---|---|
| mAP50 (all) | 0.636 |
| mAP50-95 (all) | 0.250 |
swimming AP50 / P / R |
0.845 / 0.830 / 0.815 |
drowning AP50 / P / R |
0.427 / 0.581 / 0.462 |
out_of_water |
not measurable (0 test instances) |
![]() Normalised confusion matrix (test) |
![]() Precisionβrecall curve (test) |
Only 52 drowning boxes are in the test split, from a few clips, so differences of a few points
are noise. The checkpoint's stored train_metrics were computed on the validation split, which was
part of training. Do not quote them.
Limitations and risks
- Weak drowning performance: recall 0.462, so more than half of drowning boxes are missed or misclassified per frame.
- Small drowning sample: 299 training and 52 test boxes.
out_of_wateris barely trained: 19 training boxes, 0 test boxes. Treat it as unreliable.- Unknown image provenance and mixed quality (some are low-quality video frames). 133 small candidate groups and the crowded drowning scenes were not used.
- Not validated on the project team's own camera or a real facility. False alarms per hour have not been measured. Performance across ages, body types, skin tones, pools and lighting is unknown.
- False reassurance: a missed detection can delay a response. Always keep human supervision.
- The
.ptfile is a pickle checkpoint. Load it only after checkingSHA256SUMS.txt.
Licensing
Unresolved. No LICENSE file is included on purpose. Details: LICENSE_STATUS.md.
- Data: the Roboflow export shows CC BY 4.0, but the original image sources are not verified.
- Framework / base weights: the checkpoint records Ultralytics' licence as AGPL-3.0 (https://ultralytics.com/license). This is open decision OD-7 in the project.
Attribution
Source dataset: DrowningDetectionTracking, Roboflow Universe, workspace drowningdetection-2zzxz,
shown as CC BY 4.0. The cleaning, the human drowning review and the ddt_v2 subset are the Lifeguard
System project's own work.
- Downloads last month
- 45

