> This is the documentation for LibreYOLO 1.6.0. Current version: https://www.libreyolo.com/docs/models/efficientdet

# EfficientDet
EfficientDet pairs an EfficientNet backbone with a repeated bi-directional feature pyramid network (BiFPN) and scales depth, width and resolution together across five sizes. LibreYOLO ships it as an inference-only detector.
Tasks: Detection. Install: pip install libreyolo.
Verified against LibreYOLO v1.5.0.

## Install

EfficientDet needs no optional extra. Everything it imports is in the base
install.

```bash
pip install libreyolo
```

## Predict

Weights download from Hugging Face on first use and are cached locally.

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

model = LibreYOLO("LibreEfficientDetd0.pt")
result = model(SAMPLE_IMAGE, save=True)

for box in result.boxes:
    print(box.cls, box.conf, box.xyxy)
```

**CLI**

```bash
libreyolo predict model=LibreEfficientDetd0.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
```

The returned `Results` object is the one every family returns, so swapping in a
different detector is a one line change. EfficientDet decodes anchor-based
candidates and then runs class-wise non-maximum suppression, so `conf`, `iou`
and `max_det` all have a real effect here. See [prediction](/docs/v1.6.0/predict) for
sources, streaming and result handling.

## Variants

Five sizes, D0 through D4. Each step up pairs a larger EfficientNet backbone
with a deeper, wider BiFPN and a deeper prediction head, so parameter count and
compute grow together, following the paper's compound-scaling rule.

## Validate

`val()` returns a dictionary of `metrics/` keys covering precision, recall,
mAP 50 and mAP 50-95, measured against any dataset in the format you trained on.

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibreEfficientDetd0.pt")
metrics = model.val(data="my-dataset.yaml")

print(metrics["metrics/mAP50-95"])
print(metrics["metrics/mAP50"])
```

**CLI**

```bash
libreyolo val model=LibreEfficientDetd0.pt data=my-dataset.yaml
```

## Export

| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Detection | yes | yes | yes | yes | yes |  |  |  | yes |  |  |  |

A "yes" means the export is supported. An empty cell means the exporter refuses that combination.

An exported artifact loads back through `LibreYOLO()` on its file suffix, so a
`.onnx` or `.engine` file behaves like a checkpoint and returns the same
`Results`.

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibreEfficientDetd0.pt")
model.export(format="onnx")
model.export(format="tensorrt", half=True)
```

**CLI**

```bash
libreyolo export model=LibreEfficientDetd0.pt format=onnx
libreyolo export model=LibreEfficientDetd0.pt format=tensorrt half=True
```

**Use the exported file**

```python
from libreyolo import LibreYOLO

# The factory routes on the file suffix, so an exported artifact loads
# like any checkpoint and returns the same Results object.
model = LibreYOLO("LibreEfficientDetd0.onnx")
result = model(SAMPLE_IMAGE)

print(result.boxes.xyxy)
```

## Checkpoints

Every published weight file for this family.

| File | Input (px) | Task | Weights license |
| --- | --- | --- | --- |
| `LibreEfficientDetd0.pt` |  | Detection | apache-2.0 |
| `LibreEfficientDetd1.pt` |  | Detection | apache-2.0 |
| `LibreEfficientDetd2.pt` |  | Detection | apache-2.0 |
| `LibreEfficientDetd3.pt` |  | Detection | apache-2.0 |
| `LibreEfficientDetd4.pt` |  | Detection | apache-2.0 |

## Licensing

Check the license on the Hugging Face repository of the specific weights you download. That repository is authoritative and licenses are not always uniform across a family. This is a description of the licenses involved, not legal advice.

- Original work: EfficientDet, Google Research
- Upstream license: Apache-2.0
- Upstream source: https://github.com/rwightman/efficientdet-pytorch
- LibreYOLO code: Apache-2.0
- Weights: Apache-2.0, republished at https://huggingface.co/LibreYOLO
- Interpretation: Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code. LibreYOLO's D0-D4 checkpoints are converted from Google's official TensorFlow-trained release assets through the Apache-2.0 rwightman/efficientdet-pytorch project; those release assets carry no separate per-checkpoint license, so redistribution here rests on Apache-2.0 implied by the releasing project, the same basis rwightman/efficientdet-pytorch itself uses for its own converted weights.

LibreYOLO's D0-D4 checkpoints are converted through the Apache-2.0
rwightman/efficientdet-pytorch project, which itself mirrors the official
TensorFlow-trained weights from google/automl without changing learned
tensors. No source from the LGPL-licensed
zylo117/Yet-Another-EfficientDet-Pytorch project was consulted or used.


## EfficientDet architecture

- EfficientDet D0: [SVG](/diagrams/models/efficientdet/d0.svg), [interactive diagram](/diagrams/models/efficientdet/d0.html)
- EfficientDet D1: [SVG](/diagrams/models/efficientdet/d1.svg), [interactive diagram](/diagrams/models/efficientdet/d1.html)
- EfficientDet D2: [SVG](/diagrams/models/efficientdet/d2.svg), [interactive diagram](/diagrams/models/efficientdet/d2.html)
- EfficientDet D3: [SVG](/diagrams/models/efficientdet/d3.svg), [interactive diagram](/diagrams/models/efficientdet/d3.html)
- EfficientDet D4: [SVG](/diagrams/models/efficientdet/d4.svg), [interactive diagram](/diagrams/models/efficientdet/d4.html)
- EfficientDet family: [SVG](/diagrams/models/efficientdet/family.svg), [interactive diagram](/diagrams/models/efficientdet/family.html)
