> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Predict LibreYOLO

> Run a LibreYOLO detector (YOLOv9 or LibreYOLO9E2E) on a dataset and write the images with their predictions to the output dataset.

Runs on: gpu, cpu  Dockerfile

> **Note**
>
> First run can take longer while the worker pulls the configured Docker image.

## Overview

Runs a LibreYOLO model from your workspace registry on an image or video dataset and writes the assets with their predictions to the output dataset. The input dataset stays unchanged.

Pick a **Destination dataset** to add the predictions to a dataset you already have, such as a labeling pool or an active-learning set. Existing assets are kept, and new predictions replace any previous annotations for the same image. Leave it empty and the node writes into a dataset of its own, one version per run.

Two kinds of model run here, both detectors that produce bounding boxes:

* **YOLOv9** models return one row per candidate box, which the node suppresses with NMS at the IoU threshold in **Config**.
* **LibreYOLO9E2E** models return their final detections directly. There is no NMS step, so the `iou` setting has no effect on them; **Max detections** still caps the output.

Each prediction carries its score in a `confidence` tag. The **Prediction Count** badge shows how many assets were processed and opens the output dataset.

```mermaid
flowchart LR
  n1["Train LibreYOLO"] --> n2["Predict LibreYOLO"] --> n3["Evaluate object detection"]
```

### Pretrained models

The model catalog ships eight COCO-pretrained detectors: YOLOv9 t, s, m and c (`LibreYOLO9-*`) and LibreYOLO9E2E t, s, m and c. Copy one into your workspace from the **Model** picker to use it. OvalBee hosts none of these weights: the catalog names each one's `.pt` file on Hugging Face, which the node downloads into its cache on first use and checks against the SHA-256 the catalog pins. With safe weights on, a `.pt` file is refused before it is read, so a catalog model runs once its weights are converted. The full table, with parameter counts and licences, is on the [Train LibreYOLO](/node-library/nodes/models-libreyolo-train-libreyolo) page.

## Prerequisites

| Requirement         | What you need                                                                                                                                                                            |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GPU worker**      | A worker with GPU execution enabled. The node also runs on a CPU worker, much more slowly.                                                                                               |
| **LibreYOLO model** | A LibreYOLO model in the workspace registry: a catalog model copied in from the picker, or a version trained by [Train LibreYOLO](/node-library/nodes/models-libreyolo-train-libreyolo). |

## How it works

Takes the destination dataset, or the node's own output dataset - created on the first run, a new empty version of it on a rerun - and adds the input dataset's images and videos to it without duplicating them.

Pins the output dataset to the model's ontology and loads the version's weights on the device of the run: safetensors into the network LibreYOLO defines for the version's architecture, an ONNX export through ONNX Runtime, and a LibreYOLO `.pt` through LibreYOLO itself or a TensorRT engine through LibreYOLO's TensorRT runtime, both of which only happen with safe weights off.

Runs inference in batches with the confidence and IoU thresholds of **Config** and at most **Max detections** boxes per image, keeping only the classes ticked in **Predict classes** when any are.

Uploads one prediction annotation per asset, then refreshes the output dataset's statistics.

## FAQ

#### Does the output dataset keep the input's annotations?

No. The output holds the same image and video assets as the input, but only the predictions from this run as annotations. Because both datasets share the assets, you can use them as ground truth and predictions in [Evaluate object detection](/node-library/nodes/evaluate-evaluate-object-detection).

#### What data can Predict LibreYOLO process?

Images and videos. If the dataset holds at least one image, only images are predicted: videos are still added to the output dataset but get no predictions in that run. Use separate datasets when you need inference on both. Videos are predicted frame by frame, and each detection becomes a single-frame box object.

#### What are the default thresholds?

Confidence `0.25` and NMS IoU `0.7`, the same as [Predict YOLO](/node-library/nodes/models-yolo-predict-yolo), and at most 300 detections per image. LibreYOLO's own default IoU is 0.45; the node keeps 0.7 so that a YOLOv9 and a YOLO11 model are suppressed alike. Lower `conf` (for example to `0.001`) when the predictions feed an mAP evaluation.

#### How is the output dataset named?

The first run names it after the input dataset with a `__libreyolo_predict` suffix. Reruns add versions to that same dataset, so earlier results stay in its version history.

#### What does each prediction record?

Each annotation is tagged with the task that produced it, the model version, and the model's name. Every box stores its score in the numeric `confidence` tag.

#### Which class names do predictions use?

The class list recorded on the model version, in its order. When the version records none, the names stored with the weights are used.

#### What does the Prediction Count badge count?

Processed assets, not boxes. An asset still counts when it ends up with no predictions, e.g. after class filtering.

#### Why is the output empty and the badge \`0\`?

The input dataset has no image or video assets. The output dataset is still created or versioned, but stays empty.

#### Why can't the node load the selected model?

The version must have weights: model files in its asset, or a catalog entry that names a download. With safe weights on, a pickle (`.pt`, `.pth`) is refused whatever its name, before it is read: convert it, or register safetensors or ONNX weights with [Upload model](/node-library/nodes/models-general-upload-model) if the version has none.

#### Can I run a TensorRT engine?

Yes, while **Safe weights only** is off: import the `.engine` or `.plan` file as a model version with framework `libreyolo`, the LibreYOLO architecture it was exported from (such as `libreyolo9-s`) and its classes in output order, since an engine records neither. The engine says its own input size. Loading an engine runs the native code compiled into it, so import only engines from a source you trust. It runs on a GPU machine only, and only on the GPU model and TensorRT version it was built with: on another the run fails, says what the engine was built for and what the machine has, and asks you to build the engine on that hardware or import the model's ONNX export. Pick a machine class whose machines all have the engine's GPU, since OvalBee does not send a run to it. The engine letterboxes images as LibreYOLO does by default, at the top left.

#### Why does prediction fail when inference starts?

**Config** may not be a YAML mapping, `batch` may be below `1`, **Max detections** may be below `1`, or **Config** may set a key the node fills in itself (`max_det`, `source`, `device`, `save`, `stream`, `classes`, `output_path`). Fix the YAML and remove those keys.

## Inputs

**`Dataset`** `dataset` — required

Dataset to run the model on. The output dataset holds these same assets (same ids, not copies) with the predictions, so this dataset keeps its annotations. An empty dataset gives an empty output and the run still succeeds. Key: `DATASET`.

---

**`Destination dataset`** `dataset`

Dataset the predictions are added to, keeping what it already holds. An image it already annotates gets the new prediction instead. Leave empty to use the node's own output dataset, which a rerun writes a new version of. Key: `DST_DATASET`.

---

**`Model`** `model` — required

Model to run inference with, trained in this workspace or installed from the zoo, or an ONNX export of one. With safe weights off it can also be an imported TensorRT engine, which runs only on a GPU of the model and TensorRT version it was built for. A YOLOv9 model applies NMS to its raw output, a LibreYOLO9E2E model returns its final detections directly, so the NMS IoU threshold in Config has no effect on it. Key: `MODEL`.

---

**`Predict classes`** `ontology`

Classes to keep in the predictions. Leave empty to keep everything the model detects. Values come from `MODEL`. Key: `CLASSES`.

---

**`Max detections`** `integer` — required, default: 300

Most detections kept per image, highest scores first. Minimum: `1`. Key: `MAX_DET`.

---

**`Config`** `yaml` — required

LibreYOLO prediction settings in YAML - confidence threshold, NMS IoU threshold, image size and batch size. Where images are read from and whether results are saved to disk are set for you, the maximum number of detections has its own input. Key: `CONFIG`.

---

**`Download batch size`** `integer` — required, default: 64

Number of assets downloaded at once while the model works through the previous ones. Raise it when downloading cannot keep up with inference. Minimum: `1`. Key: `DOWNLOAD_BATCH_SIZE`.

---

**`Prefetch batches`** `integer` — required, default: 4

How many batches of downloaded assets may wait on local disk ahead of the model. Higher values ride out slow downloads at the cost of disk space. Minimum: `1`. Key: `PREFETCH_BATCHES`.

---

## Outputs

**`Output Dataset`** `dataset`

Dataset with the input images plus the LibreYOLO prediction annotations: the destination dataset when one is picked, otherwise the node's own. Shown as an artifact. Key: `OUTPUT_DATASET`.

---

**`Prediction Count`** `string`

Badge showing the number of images annotated. Shown on the node as a badge. Selecting the badge opens `OUTPUT_DATASET`. Key: `PRED_COUNT`.

---

## Models and configuration

#### Default Config

| Setting | Default | Meaning                                            |
| ------- | ------: | -------------------------------------------------- |
| `batch` |    `16` | Images per forward pass                            |
| `imgsz` |   `640` | Inference image size                               |
| `conf`  |  `0.25` | Confidence threshold                               |
| `iou`   |   `0.7` | NMS IoU threshold; ignored by LibreYOLO9E2E models |

The maximum number of detections per image is its own input, **Max detections**, not a **Config** key. Other arguments of LibreYOLO's `predict` pass through unchanged.

## Runtime

#### Details

* Configured image: `ovalbee/node-libreyolo:0.0.17`, shared with the train and export nodes.
* Upstream base: the OvalBee PyTorch CUDA 12.8 base image, with `libreyolo==1.6.0` installed on top.
* Exact CUDA, PyTorch, NVIDIA driver, and GPU compatibility depends on the image digest deployed by the worker.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Predict LibreYOLO",
  "description": "Run a LibreYOLO detector (YOLOv9 or LibreYOLO9E2E) on a dataset and write the images with their predictions to the output dataset.",
  "category": "Predict",
  "namespace": "ovalbee",
  "templateKey": "models/libreyolo/predict_libreyolo",
  "version": "v1",
  "inputs": [
    {
      "key": "DATASET",
      "label": "Dataset",
      "type": "dataset",
      "description": "Dataset to run the model on. The output dataset holds these same assets (same ids, not copies) with the predictions, so this dataset keeps its annotations. An empty dataset gives an empty output and the run still succeeds.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    },
    {
      "key": "DST_DATASET",
      "label": "Destination dataset",
      "type": "dataset",
      "description": "Dataset the predictions are added to, keeping what it already holds. An image it already annotates gets the new prediction instead. Leave empty to use the node's own output dataset, which a rerun writes a new version of.",
      "required": false,
      "default": null,
      "visibleWhen": null
    },
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "Model to run inference with, trained in this workspace or installed from the zoo, or an ONNX export of one. With safe weights off it can also be an imported TensorRT engine, which runs only on a GPU of the model and TensorRT version it was built for. A YOLOv9 model applies NMS to its raw output; a LibreYOLO9E2E model returns its final detections directly, so the NMS IoU threshold in Config has no effect on it.\n",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "framework": "libreyolo",
        "tensorrt_engines": true
      }
    },
    {
      "key": "CLASSES",
      "label": "Predict classes",
      "type": "ontology",
      "description": "Classes to keep in the predictions. Leave empty to keep everything the model detects.",
      "required": false,
      "default": null,
      "visibleWhen": null,
      "options": {
        "ref": "MODEL",
        "selectable": true
      }
    },
    {
      "key": "MAX_DET",
      "label": "Max detections",
      "type": "number",
      "description": "Most detections kept per image, highest scores first.",
      "required": true,
      "default": 300,
      "visibleWhen": null,
      "options": {
        "type": "integer",
        "min": 1
      }
    },
    {
      "key": "CONFIG",
      "label": "Config",
      "type": "yaml",
      "description": "LibreYOLO prediction settings in YAML - confidence threshold, NMS IoU threshold, image size and batch size. Where images are read from and whether results are saved to disk are set for you; the maximum number of detections has its own input.",
      "required": true,
      "default": "batch: 16\nimgsz: 640\nconf: 0.25\niou: 0.7\n",
      "visibleWhen": null
    },
    {
      "key": "DOWNLOAD_BATCH_SIZE",
      "label": "Download batch size",
      "type": "number",
      "description": "Number of assets downloaded at once while the model works through the previous ones. Raise it when downloading cannot keep up with inference.",
      "required": true,
      "default": 64,
      "visibleWhen": null,
      "options": {
        "type": "integer",
        "min": 1
      }
    },
    {
      "key": "PREFETCH_BATCHES",
      "label": "Prefetch batches",
      "type": "number",
      "description": "How many batches of downloaded assets may wait on local disk ahead of the model. Higher values ride out slow downloads at the cost of disk space.",
      "required": true,
      "default": 4,
      "visibleWhen": null,
      "options": {
        "type": "integer",
        "min": 1
      }
    }
  ],
  "outputs": [
    {
      "key": "OUTPUT_DATASET",
      "label": "Output Dataset",
      "type": "dataset",
      "description": "Dataset with the input images plus the LibreYOLO prediction annotations: the destination dataset when one is picked, otherwise the node's own.",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "PRED_COUNT",
      "label": "Prediction Count",
      "type": "string",
      "description": "Badge showing the number of images annotated.",
      "artifact": false,
      "badge": true,
      "badgeOpens": "OUTPUT_DATASET",
      "hidden": false
    }
  ],
  "runtime": {
    "type": "docker",
    "devices": [
      "gpu",
      "cpu"
    ],
    "dockerImage": "ovalbee/node-libreyolo:0.0.17"
  },
  "widgets": {
    "widget": {
      "id": "asset-preview",
      "settings": {
        "datasetId": {
          "type": "variable",
          "value": "self.outputs.OUTPUT_DATASET"
        }
      }
    }
  }
}
```

## References

#### Sources and related pages

* [Train LibreYOLO](/node-library/nodes/models-libreyolo-train-libreyolo)
* [Export LibreYOLO](/node-library/nodes/models-libreyolo-export-libreyolo)
* [Evaluate object detection](/node-library/nodes/evaluate-evaluate-object-detection)
* [LibreYOLO repository](https://github.com/LibreYOLO/libreyolo) (MIT)