Tenzro Testnet is live —request testnet TNZO
← Back to Tutorials

Detect Objects with RF-DETR

DetectionIntermediate15 min

Tenzro's detection runtime serves NMS-free DETR-family object detectors: RF-DETR (nano / small / medium / base / large / 2xl) and D-FINE (n / s / m / l / x). All entries are permissively licensed and load without any acceptance flag. This tutorial uses rfdetr-base as a balanced default and runs detection via both the CLI and JSON-RPC.

1. Download the model

# RF-DETR is permissively licensed (Apache-2.0)
tenzro model download rfdetr-base

# Output:
# Resolving artifact bundle from HuggingFace Hub...
#   Source: roboflow/rf-detr-base (ONNX export)
#   License tier: Permissive
#   Files: model.onnx, config.json
#   SHA-256 verified
#   Saved to: ~/.tenzro/models/rfdetr-base/

2. Load into the detection runtime

DETR-family models are NMS-free — the runtime applies sigmoid scoring and a configurable score threshold instead of non-maximum suppression.

# Load into the detection runtime
tenzro detection load rfdetr-base

# Output:
# Detection runtime loaded:
#   Model: rfdetr-base
#   Modality: detection
#   Input resolution: 640x640
#   Postprocessing: NMS-free DETR (sigmoid + score threshold)

3. Detect via the CLI

# Run detection on an image with a 0.4 score threshold
tenzro detect \
  --model rfdetr-base \
  --image ./street.jpg \
  --score-threshold 0.4

# Output:
# Detected 7 objects:
#   person       0.92  bbox=(120, 180, 195, 410)
#   person       0.88  bbox=(305, 220, 380, 440)
#   bicycle      0.74  bbox=(415, 290, 510, 380)
#   car          0.69  bbox=(540, 200, 720, 320)
#   traffic_light 0.61 bbox=(50, 80, 75, 130)
#   dog          0.55  bbox=(220, 380, 290, 460)
#   backpack     0.42  bbox=(310, 240, 360, 310)
# latency_ms: 47

4. Detect via JSON-RPC

# Equivalent JSON-RPC call. Image is base64-encoded raw bytes.
IMAGE_B64=$(base64 -i ./street.jpg)

curl https://rpc.tenzro.network \
  -X POST \
  -H "Content-Type: application/json" \
  -d "{
    \"jsonrpc\": \"2.0\",
    \"id\": 1,
    \"method\": \"tenzro_detect\",
    \"params\": {
      \"model_id\": \"rfdetr-base\",
      \"image_base64\": \"$IMAGE_B64\",
      \"score_threshold\": 0.4
    }
  }" | jq

A typical response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "model_id": "rfdetr-base",
    "detections": [
      {
        "label_id": 0,
        "label": "person",
        "score": 0.92,
        "bbox": { "x_min": 120, "y_min": 180, "x_max": 195, "y_max": 410 }
      },
      {
        "label_id": 0,
        "label": "person",
        "score": 0.88,
        "bbox": { "x_min": 305, "y_min": 220, "x_max": 380, "y_max": 440 }
      }
    ],
    "latency_ms": 47
  }
}

5. Pick the right size

# Detection catalog (all permissively licensed):
#   rfdetr-nano        smallest, fastest
#   rfdetr-small
#   rfdetr-medium
#   rfdetr-base        used here
#   rfdetr-large
#   rfdetr-2xl         highest accuracy
#   d-fine-n / -s / -m / -l / -x   D-FINE family alternative

See also