Downloads · 30 days
16
6% of all-time downloads
FishingROV/cascade_teacher_yolo_swin
cascade_teacher_yolo_swin is a object detection model from FishingROV. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as cc-by-4.0.
Single-folder, repeatable bundle for FishingROV cascade feedback runs.
Downloads · 30 days
16
6% of all-time downloads
All-time downloads
286
Public
Repo size
466 MB
Likes
0
Public
Click a slice to open those files.
.pt466 MB · 100%
From the Hugging Face model README
Single-folder, repeatable bundle for FishingROV cascade feedback runs.
chungus_1cls_best.pt)swinv2_384_best.pt)scripts/run_video.sh)This bundle supersedes prior split usage of older 1cls detector + SwinV2-256 references for cascade testing.
Use this section first if you are wiring the bundle into your own environment.
scripts/run_video.shUsage:
bash scripts/run_video.sh /path/to/video.mp4 [optional_out_dir]
Arguments:
$1 (required): video file path$2 (optional): output directory (defaults to runs/video_YYYYmmdd_HHMMSS)Env override:
CONFIG=/path/to/config.json to use a different mode configscripts/run_images.shUsage:
bash scripts/run_images.sh /path/to/images_dir [optional_out_dir]
Arguments:
$1 (required): folder containing images (.jpg/.jpeg/.png/.bmp/.webp)$2 (optional): output directoryEnv override:
CONFIG=/path/to/config.json to use a different mode configscripts/run_from_config.pyUsage (video):
scripts/run_from_config.py --config config/mode_video_default.json --video-input /path/to/video.mp4
Usage (images):
scripts/run_from_config.py --config config/mode_video_default.json --images-dir /path/to/images
Arguments:
--config (required): mode config JSON--video-input (required for video mode): input video path--images-dir (required for image mode): image-folder path--out-dir (optional): explicit output folder--skip-convert (optional flag): skip dive convert and dive verify-dive-json--max-images (optional): runtime override for max frames/images processedNote:
--video-input or --images-dir.scripts/fetch_weights.shUsage:
bash scripts/fetch_weights.sh
Behavior:
weights.*.hf_url and weights.*.local from configEnv override:
CONFIG=/path/to/config.json to fetch from a different confignumpytorchultralyticstimmtorchvisionopencv-pythonPillowpyyamlInstall example:
python -m pip install numpy torch ultralytics timm torchvision opencv-python Pillow pyyaml
dive CLI is required only when conversion/verification is enabled.dive is unavailable, run with --skip-convert.Edit config/mode_video_default.json:
paths.python: Python executable for your environmentpaths.infer_script: path to infer_cascade_yolo_swin_to_viame.pypaths.dive_bin: dive binary name/pathweights.*.local: local weight pathsweights.*.hf_url: remote weight URLsAll hardware tuning is done in config/mode_video_default.json under runtime and video.
Main runtime knobs:
runtime.conf: detector confidence threshold (default 0.1 for reported comparison)runtime.imgsz: detector inference size (higher = more compute, often better recall)runtime.yolo_batch: detector batch sizeruntime.cls_batch: classifier batch sizeruntime.max_images: cap on total processed frames/images (0 = no cap)video.fps_sample: sampling rate for video frame extractionRecommended starting points by hardware class:
runtime.yolo_batch=1runtime.cls_batch=2 to 4runtime.imgsz (for example 960)video.fps_sample if throughput is lowruntime.yolo_batch=1runtime.cls_batch=8 to 16runtime.imgsz=1280 if memory allowsruntime.cls_batch firstruntime.yolo_batch to 2 if stableruntime.conf=0.1 if you want comparability with card metricsIf running on different cameras or panel geometry, update:
runtime.left_xmin, runtime.left_xmaxruntime.right_xmin, runtime.right_xmaxruntime.roi_ymin, runtime.roi_ymaxIf matching/merge behavior needs adjustment, update:
runtime.merge_iouIf class balance or operating point differs, update:
runtime.class_thresholds (format: king=...,queen=...,dead=...,not_a_scallop=...)Status: PRELIMINARY / NOT INDEPENDENTLY VERIFIED.
These are internal station-disjoint held-out metrics from the current pipeline experiment log and are provided for early feedback, not as a final benchmark.
Held-out split: scallop_lr_teacher_1280_v2_heldout_4cls test subset.
Detector stage for the comparison below is run at conf=0.1.
Cascade decision rule used for these metrics:
argmax(softmax_prob[class] / class_threshold[class]),king=0.1, queen=0.7, dead=0.14, not_a_scallop=1.0.| Metric | Value |
|---|---|
| King F1 | 0.541 |
| Queen F1 | 0.773 |
| Dead F1 | 0.459 |
| Macro F1 (K/Q/D) | 0.591 |
Reference source in project experiments log: EXP-2026-06-16-PIPELINE-CONF-0P1-NORMARGMAX.
| Source | king F1 | queen F1 | dead F1 | Macro F1 (K/Q/D) | Detector P | Detector R |
|---|---|---|---|---|---|---|
| Cascade conf=0.1 + normalized weighted argmax (this card) | 0.541 | 0.773 | 0.459 | 0.591 | 0.649 | 0.660 |
| Chungus 4cls detector-only baseline | 0.392 | 0.633 | 0.364 | 0.463 | 0.602 | 0.478 |
Bundle default runtime config also uses detector conf=0.1.
Global classifier-threshold sweep (matched detections, same run):
0.350.8520.9920.917Interpretation caveat:
Bundle repo:
Direct weight links:
config/mode_video_default.json: default runtime modescripts/run_video.sh: one-command entrypointscripts/run_from_config.py: config runnerscripts/fetch_weights.sh: HF weight fetch helperexperimental/with_viame/cascade_teacher_yolo_swin.pipe: experimental VIAME/KWIVER pipeline scaffoldexperimental/with_viame/README.md: outstanding requirements for drop-in DIVE compatibilityweights/chungus_1cls_best.pt (local optional cache, ignored by git)weights/swinv2_384_best.pt (local optional cache, ignored by git)If your goal is DIVE Web/Desktop pipeline integration, start with:
experimental/with_viame/cascade_teacher_yolo_swin.pipeexperimental/with_viame/README.mdImportant:
.pipe is intentionally marked experimental and is not guaranteed drop-in across all VIAME builds.numpytorchultralyticstimmtorchvisionopencv-pythonPillowpyyamldive) for optional conversion/verify.bash scripts/run_video.sh /path/to/video.mp4
Optional explicit output directory:
bash scripts/run_video.sh /path/to/video.mp4 /path/to/output_dir
Run on an image folder:
bash scripts/run_images.sh /path/to/images_dir
Optional explicit output directory (images):
bash scripts/run_images.sh /path/to/images_dir /path/to/output_dir
This model bundle is a derivative work based on the University of St Andrews King Scallop dataset.
In accordance with the original dataset's terms, this derivative work is released under the Creative Commons Attribution 4.0 International (CC-BY 4.0) license. You are free to share and adapt this material, provided you give appropriate credit to the original authors and indicate if changes were made.
NatureScot attribution note: