Maritime SAR โ RF-DETR Nano
A fine-tuned RF-DETR Nano model for detecting people in maritime rescue scenes. The single foreground class is rescue. Detections are person candidates and crowded vessels. They do not establish distress or the need for rescue.
Example
An Italian Coast Guard rescue scene with predictions from this model:
Frame credit: Guardia Costiera.
Choose a format
Both versions use the same EMA model:
| Format | Files | Weight size | Usage |
|---|---|---|---|
| FP32 SafeTensors | model.safetensors |
121 MB | Load into PyTorch / RF-DETR |
| OpenVINO mixed INT8 | openvino-int8/native-768.xml and .bin |
30 MB | Ready-to-run CPU inference |
OpenVINO retains FP32 classification and box heads. Both versions produce floating-point scores and coordinates.
CPU inference with OpenVINO
Install the CPU dependencies and run inference on an image:
python -m pip install -r openvino-int8/requirements.txt
python predict_openvino.py image.jpg --confidence 0.25 --threads 8 --output predictions.json
The helper processes the complete image as overlapping native 768ร768 windows, pads smaller windows, and returns merged boxes in original-image coordinates. It does not downsample the input.
To reuse the compiled model from Python:
import numpy as np
from PIL import Image, ImageOps
from predict_openvino import OpenVINORescue
with Image.open("image.jpg") as image:
rgb = np.array(ImageOps.exif_transpose(image).convert("RGB"), dtype=np.uint8)
detector = OpenVINORescue(threads=8)
detections = detector.predict_rgb(rgb, confidence=0.25)
Load SafeTensors into RF-DETR
Install the PyTorch / RF-DETR dependencies:
python -m pip install -r requirements.txt
Load the weights for use in your own PyTorch inference pipeline:
from load_model import load_model
detector = load_model("model.safetensors", device="cpu")
core = detector.model.model
load_model.py constructs the architecture and strictly loads all model tensors.
This path uses RF-DETR and SafeTensors; it has no OpenVINO dependency. The example
above loads the model only. RF-DETR 1.11.2 does not load this SafeTensors file
directly through pretrain_weights.
Native inference conventions
These conventions apply to both backends:
- Input: RGB integer crops with black padding on the right/bottom. The Boolean
mask is True on padding. Normalize RGB/255 using mean
[0.485, 0.456, 0.406]and standard deviation[0.229, 0.224, 0.225]. - Class: compute
sigmoid(pred_logits[..., 1]). Logit column 0 is unused. - Boxes: normalized CXCYWH coordinates use the valid crop width and height, excluding padding. Clip to the crop, add its source origin, then merge overlapping predictions with IoU 0.5 and a maximum of 100 detections.
The OpenVINO helper implements native 768 windows with 25% overlap. The PyTorch
reference pipeline also uses native 2048 context windows for larger images;
OpenVINO omits that pass, which changes coverage for large people crossing windows.
For native PyTorch windows, set core.backbone[0].encoder.shape = (size, size)
and retain the learned 24ร24 positional encoding. Upstream detector.predict()
uses its own resizing policy and does not automatically reproduce this pipeline.
Tiny people, occlusion, low light, glare and unfamiliar viewpoints can produce misses or false positives. No rescue operating threshold is certified.
Licence and integrity
The publisher's model contributions are licensed under CC BY-NC-SA 4.0 International. See LICENSE and LICENSE_SCOPE.md. Upstream RF-DETR contributions and the supplied Python helpers retain Apache-2.0; see NOTICE and LICENSE.upstream-RFDETR. The example image retains its own rights and is excluded from the model licence.
Verify the package from this folder:
sha256sum -c SHA256SUMS
- Downloads last month
- 8
