TEED

TEED (Tiny and Efficient Edge Detector) is a small convolutional network that predicts a dense edge-probability map from one RGB image. LibreYOLO wraps its architecture for edge detection only; no checkpoint ships with the library.

Tasks
edge
Sizes
t at 352 px
Install
pip install libreyolo
Support tier
Inference only, since v. Predict, validate and export only. Training features do not apply.
Upstream
TEED by Xavier Soria, MIT. Paper, source
Licenses
Code MIT, weights MIT. Commercial use

Install

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

bash
pip install libreyolo

Predict

LibreYOLO ships no TEED checkpoint. The officially released weights are trained on BIPED, whose published dataset terms restrict use to non-commercial purposes, so LibreYOLO does not mirror them. Convert a checkpoint you are licensed to use with weights/convert_teed_weights.py, which checks the tensor keys against the runtime architecture before writing a file LibreYOLO can load directly:

bash
python weights/convert_teed_weights.py upstream.pth weights/LibreTEEDt-edge.pt --verify

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("weights/LibreTEEDt-edge.pt")result = model(SAMPLE_IMAGE, save=True) edges = result.edgesprint(edges.array.shape)        # (H, W) float32 in [0, 1]print(edges.binary(0.5).sum())  # thresholded edge-pixel count
CLI
libreyolo predict model=weights/LibreTEEDt-edge.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True

result.edges holds the result: an (H, W) float32 array in [0, 1], with .binary(threshold) returning a boolean edge mask. There are no boxes, so conf, iou and max_det have no effect. See prediction for sources, streaming and result handling.

Variants

TEED ships one size in LibreYOLO. LibreYOLO's benchmark harness has not measured this family, so there are no published numbers to compare it against.

Validate

val() reports BSDS-style ODS and OIS F-measures against a paired edge dataset: images beside same-stem edge maps, with an optional validity mask so padded pixels never count. imgsz must be divisible by the network's downsample stride, and LibreYOLO raises a clear error if it is not.

Python
from libreyolo import LibreYOLO model = LibreYOLO("weights/LibreTEEDt-edge.pt")metrics = model.val(data="my-dataset.yaml", imgsz=352) print(metrics["metrics/ODS"])   # optimal-dataset-scale F-measureprint(metrics["metrics/OIS"])   # optimal-image-scale F-measure
CLI
libreyolo val model=weights/LibreTEEDt-edge.pt data=my-dataset.yaml imgsz=352

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
edgeedge to ONNX: supported. edge to TorchScript: supported. edge to ExecuTorch: supported. edge to TensorRT: supported. edge to OpenVINO: supported. edge to Paddle: not supportededge to MNN: not supportededge to RKNN: not supportededge to ncnn: not supportededge to TFLite: supported. edge to CoreML: not supportededge to Core AI: not supported

Edge export uses a fixed-resolution, batch-1 runtime contract: dynamic and a batch other than 1 are rejected, and the exported graph outputs a single fused probability map. An exported artifact loads back through LibreYOLO() on its file suffix, so a .onnx file behaves like a checkpoint and returns the same Results.

Python
from libreyolo import LibreYOLO model = LibreYOLO("weights/LibreTEEDt-edge.pt")model.export(format="onnx", imgsz=352)model.export(format="tensorrt", imgsz=352, half=True)
CLI
libreyolo export model=weights/LibreTEEDt-edge.pt format=onnx imgsz=352libreyolo export model=weights/LibreTEEDt-edge.pt format=tensorrt imgsz=352 half=True
Use the exported file
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("weights/LibreTEEDt-edge.onnx")result = model(SAMPLE_IMAGE) print(result.edges.array.shape)

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
TEED, Xavier Soria
Upstream license
MIT
Upstream source
github.com/xavysp/TEED
LibreYOLO code
MIT
Weights
MIT, distributed by their authors. LibreYOLO does not host or mirror them.
Interpretation
MIT is a permissive license, so the TEED architecture LibreYOLO ports can be used in commercial and closed-source products, with the license text and copyright notice kept alongside any copy you redistribute. LibreYOLO ships no checkpoint for this family: the officially released weights are trained on BIPED, whose published dataset terms restrict use to non-commercial purposes, and mirroring them would carry that restriction into a nominally MIT-licensed download. Convert a checkpoint you hold a license for with `weights/convert_teed_weights.py`; the MIT code license does not change the terms attached to whatever checkpoint you convert.

LibreYOLO publishes no TEED checkpoint. Nothing is mirrored under the LibreYOLO organization; convert a checkpoint you hold a license for with weights/convert_teed_weights.py instead.

Citation

@InProceedings{Soria_2023teed,
    author    = {Soria, Xavier and Li, Yachuan and Rouhani, Mohammad and Sappa, Angel D.},
    title     = {Tiny and Efficient Model for the Edge Detection Generalization},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops},
    month     = {October},
    year      = {2023},
    pages     = {1364-1373}
}

Copied from the authors' citation block at github.com/xavysp/TEED#citation.

Verified against LibreYOLO v1.5.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.