Downloads · 30 days
50
27% of all-time downloads
True2456/Shark-Patrol-yolo
Shark-Patrol-yolo is a object detection model from True2456. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as other.
Two YOLOv8s detectors for overhead (drone / beach-tower) imagery. Classes:
Downloads · 30 days
50
27% of all-time downloads
All-time downloads
184
Public
Repo size
45 MB
Likes
0
Public
Click a slice to open those files.
.pt45 MB · 100%
From the Hugging Face model README
Two YOLOv8s detectors for overhead (drone / beach-tower) imagery. Classes:
| id | name |
|---|---|
| 0 | shark |
| 1 | swimmer |
| Weights file | What it is |
|---|---|
weights/yolov8s_aerial_shark_swimmer.pt | Combined v2 — COCO-pretrained YOLOv8s trained on Cosmos 3 synthetic aerial sharks + 28 real shark stills + hard negatives (boats, dolphins, empty ocean). |
weights/yolov8s_aerial_shark_swimmer_surfneg.pt | Surfer hard-negative fine-tune — starts from Combined v2 (keeps the same real shark stills), short low-LR fine-tune with +24 real surfer photos labeled as backgrounds (empty YOLO txt). Prefer this for beach video with surfers. |
License: personal / non-commercial only — see LICENSE.
Not a safety system. Do not use as the sole input for beach closures, rescue, or maritime alerting.
Related earlier single-class beta: True2456/aerial-shark-yolo-beta.
Collecting enough real labeled aerial shark footage is slow and expensive. The working hypothesis here is the same one used in sim-to-real robotics and synthetic detection work: generate controlled synthetic overhead scenes with a world model (NVIDIA Cosmos 3), auto-label them with an open-vocabulary detector, mix in real shark stills, then actively mine hard negatives (objects that look like sharks from altitude — surfboards, dolphins, boat wakes) so the classifier stops treating them as positives.
This release is the practical result of that loop for a two-class (shark / swimmer) beach-surveillance detector. Both published checkpoints were trained with synthetic Cosmos 3 shark scenes + 28 real shark photos (plus hard negatives).
NVIDIA Cosmos 3 synthetic aerial ──┐
├─► Grounding DINO auto-boxes ─► YOLO labels
real shark stills (irlshark) ──────┘ │
▼
quality filters (score, area, NMS-ish caps)
│
hard negatives (boats, dolphins, ▼
surfers, empty ocean) ── empty .txt ─► Ultralytics YOLOv8s train (MPS)
│
Combined v2 weights
│
+ surfer stills (empty labels)
low LR AdamW fine-tune
▼
surfneg fine-tuned weights
Synthetic overhead beach / ocean scenes were generated with NVIDIA Cosmos 3 (local Cosmos3-Nano MLX build, driven through the SurfLifeGen / MLX_TrainDetect tooling). Cosmos is NVIDIA’s physical-AI world foundation model family, used here as a generator for aerial water scenes with sharks and related clutter — including variation in water appearance (turbidity, sun glint, surface texture) and shark silhouette / submersion cues that matter from altitude (NVIDIA Cosmos; Cosmos 3 overview).
Generated frames were ranked into high / med / low quality buckets; only high + med entered training. Prompt / viewpoint / altitude diversity is the domain-randomization side of the same loop (Tobin et al., IROS 2017).
Boxes for synthetic frames and for the real shark stills were proposed by Grounding DINO (IDEA-Research/grounding-dino-base) with text prompts such as:
submerged shark . shark in water . marine predator silhouette .
Grounding DINO is an open-set detector that grounds language queries to boxes (Liu et al., “Grounding DINO…”, arXiv:2303.05499; ECCV 2024). Export to YOLO class cx cy w h (normalized) was done after:
Manual correction passes exist on parts of the aerial set (labels_corrected/, correction reports). Labels are still imperfect; treat them as research-grade.
Both Combined v2 and the surfneg fine-tune include real shark-positive images, not synthetic-only.
| Real source | Role | Count in Combined v2 |
|---|---|---|
irlshark screenshots | shark positives (class 0 boxes) | 28 (25 train / 3 val) |
| Boats / dolphins / real swimmers / surfers | hard negatives (empty labels) | 50+ (surfneg adds 24 more surfers) |
The 28 irlshark frames are real aerial / drone screenshots of sharks, auto-boxed with Grounding DINO then exported to YOLO. They are the labeled real-shark bridge; synthetic Cosmos 3 frames supply volume and lighting / water diversity. Without the IRL positives, earlier synthetic-only runs looked strong on synthetic val and weaker on beach video.
False positives on surfers, boats, and dolphins are the failure mode that matters in beach video. Those photos were added with empty label files (Ultralytics treats them as background images). That is classical hard-negative mining / bootstrapping: show the network the mistakes you care about and force the classification head to score them as “no object” (Shrivastava et al., OHEM, CVPR 2016; long lineage back to discriminative part models and SVM hard-neg mining).
Combined v2 already included boats, dolphins, real swimmers-without-boxes, and empty aerial frames. The surfneg checkpoint adds 24 real surfer photos and fine-tunes from v2 rather than training from yolov8s.pt again (from-scratch retrain with the same negs underperformed on video).
Architecture: YOLOv8s via Ultralytics (COCO-pretrained). Training was on Apple Silicon MPS.
| Combined v2 | Surfneg fine-tune | |
|---|---|---|
| Init | yolov8s.pt | Combined v2 best.pt |
| Images | 534 (454 train / 80 val) | 558 (474 / 84) — v2 data + 24 surfers |
| Shark boxes / swimmer boxes | 404 / 75 | same boxes + more backgrounds |
| Hard-negative images | 125 | 149 |
| Epochs (patience) | 80 (patience 25) | 25 (patience 10) |
| Batch / imgsz | 128 / 640 | 64 / 640 |
| Optimizer / lr0 | Ultralytics auto (AdamW) | AdamW / 5e-4 |
| Mosaic | 0.8 (close last 15) | 0.3 (close last 10) |
| Device | MPS | MPS |
Held-out val (Ultralytics default split metrics at best checkpoint):
| Checkpoint | all mAP50 | shark mAP50 | swimmer mAP50 |
|---|---|---|---|
| Combined v2 | 0.66 | ~0.81 | ~0.52 |
| Surfneg FT | 0.71 | 0.92 | 0.51 |
Swimmer metrics are noisy (few val instances). Prefer surfneg on real beach video; keep combined v2 if you need a checkpoint that never saw the surfer stills.
pip install ultralytics
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id="True2456/Shark-Patrol-yolo",
filename="weights/yolov8s_aerial_shark_swimmer_surfneg.pt",
)
model = YOLO(path)
model.predict(source="beach.mp4", device="mps", conf=0.25, show=True)
Or download both .pt files from the Files tab and load by path.
Useful runtime knobs for video:
conf (e.g. 0.35–0.45) if surfers still trigger low-confidence shark boxes.classes=[0].track().Approximate image counts by source (from training manifest):
| Source | Role | ~Images |
|---|---|---|
| Cosmos 3 high-alt synthetic (high+med) | shark positives | 169 |
| Cosmos 3 aerial ranked set (high+med) | shark positives | 14 |
Real shark stills (irlshark) | shark positives | 28 |
| Shark/swimmer synthetic pack | shark + swimmer boxes | 198 |
| Boats / dolphins / real swimmers | hard negatives | 50 |
| Empty aerial hard negatives | hard negatives | 75 |
Surfneg keeps the same shark positives (including all 28 real shark stills) and adds 24 labeled-empty surfer stills.
nc > 2.@misc{true2456_aerial_shark_swimmer_yolo_v2,
author = {True2456},
title = {Aerial Shark–Swimmer YOLO v2},
year = {2026},
howpublished = {\url{https://huggingface.co/True2456/Shark-Patrol-yolo}},
note = {Personal use only. Experimental detector weights.}
}