EoMT

一个建在普通 vision transformer 上的分割网络,没有专门的像素解码器:加到编码器本身上的额外可学习查询(query)直接预测掩码。LibreYOLO 支持用它做语义分割、实例分割和全景分割。

任务
semantic segmentation, instance segmentation, panoptic segmentation
尺寸
s, b, l at 512 px
安装
pip install "libreyolo[eomt]"
支持层级
仅推理,自 v1.3.1 起。仅支持预测、验证和导出。训练相关的功能不适用。
上游
EoMT,由 TU Eindhoven, Mobile Perception Systems Lab 发布,采用 MIT 许可。论文、源码
许可
代码采用 MIT,权重采用 MIT。商用

安装

EoMT 不需要任何可选 extra。它导入的一切都在基础安装里。

bash
pip install libreyolo

预测

权重在首次使用时从 Hugging Face 下载,并缓存在本地。文件名里的任务后缀 (-sem、-seg、-panoptic)决定任务,LibreYOLO() 会从这个文件名把它推断 出来,所以不需要 task= 参数。

语义分割
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreEoMTl-sem.pt")result = model(SAMPLE_IMAGE, save=True) mask = result.semantic_maskprint(mask.data.shape)   # (H, W) 类别 idprint(mask.classes)      # 图像中出现的类别 id,已排序
实例分割
from libreyolo import LibreYOLO, SAMPLE_IMAGE # 文件名里的 -seg 后缀会选中实例任务,所以这里不需要# 传 task 参数model = LibreYOLO("LibreEoMTl-seg.pt")result = model(SAMPLE_IMAGE, save=True) print(result.boxes.xyxy)print(result.masks.data.shape)
全景分割
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreEoMTl-panoptic.pt")result = model(SAMPLE_IMAGE, save=True) pan = result.panopticprint(pan.data.shape)       # (H, W) 分段 idprint(pan.segments_info)    # [{"id": ..., "category_id": ...}, ...]
CLI
libreyolo predict model=LibreEoMTl-sem.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True

语义分割填充 result.semantic_mask,它在 .data 上是一个由类别 id 组成的 (H, W) 数组。实例分割填充 result.boxes 和 result.masks,形状和其他每个 分割家族返回的一样。全景分割填充 result.panoptic:.data 上是一张 (H, W) 的分段 id 图,另外还有 .segments_info,一个由 {"id", "category_id"} 字典 组成的列表,每个分段一项。conf 过滤查询的选择;iou 对语义任务不起作用, 因为它是逐像素取 argmax,没有 NMS 步骤。数据源、流式处理和结果处理见 预测。

变体

三种编码器尺寸 s/b/l,全部基于 DINOv2。语义检查点(checkpoint)在 ADE20K 上以 512 px 训练;实例和全景检查点在 COCO 上以 640 px 训练,另有第二个以 1280 px 训练的实例检查点。上游只在 l 尺寸上提供 DINOv2 的实例分割权重;s 和 b 只发布了 语义和全景两种。上游存在基于 DINOv3 的 EoMT 变体,但这里没有提供,因为它们依赖 需要申请权限的(gated)非商用 DINOv3 权重。

LibreYOLO 不训练 EoMT:对这个家族调用 train() 会抛出 NotImplementedError, 上面的支持层级把它标为仅推理。

验证

val() 按任务分发。语义返回 metrics/mIoU 和 metrics/pixel_accuracy。实例 分割返回和其他分割家族一样的掩码与检测框 mAP 键。全景返回全景质量(Panoptic Quality),键为 metrics/PQ,并拆分成 metrics/SQ(分割质量)和 metrics/RQ(识别质量),另有 metrics/PQ_things 和 metrics/PQ_stuff。

语义分割
from libreyolo import LibreYOLO model = LibreYOLO("LibreEoMTl-sem.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mIoU"])print(metrics["metrics/pixel_accuracy"])
实例分割
from libreyolo import LibreYOLO model = LibreYOLO("LibreEoMTl-seg.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95(M)"])   # 掩码print(metrics["metrics/mAP50-95(B)"])   # 检测框
全景分割
from libreyolo import LibreYOLO model = LibreYOLO("LibreEoMTl-panoptic.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/PQ"])print(metrics["metrics/SQ"], metrics["metrics/RQ"])
CLI
libreyolo val model=LibreEoMTl-sem.pt data=my-dataset.yaml

导出

任务ONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
Semantic segmentationSemantic segmentation to ONNX:支持Semantic segmentation to TorchScript:支持Semantic segmentation to ExecuTorch:不支持Semantic segmentation to TensorRT:支持Semantic segmentation to OpenVINO:支持Semantic segmentation to Paddle:不支持Semantic segmentation to MNN:不支持Semantic segmentation to RKNN:不支持Semantic segmentation to ncnn:不支持Semantic segmentation to TFLite:不支持Semantic segmentation to CoreML:不支持Semantic segmentation to Core AI:不支持
Instance segmentationInstance segmentation to ONNX:不支持Instance segmentation to TorchScript:不支持Instance segmentation to ExecuTorch:不支持Instance segmentation to TensorRT:不支持Instance segmentation to OpenVINO:不支持Instance segmentation to Paddle:不支持Instance segmentation to MNN:不支持Instance segmentation to RKNN:不支持Instance segmentation to ncnn:不支持Instance segmentation to TFLite:不支持Instance segmentation to CoreML:不支持Instance segmentation to Core AI:不支持
Panoptic segmentationPanoptic segmentation to ONNX:不支持Panoptic segmentation to TorchScript:不支持Panoptic segmentation to ExecuTorch:不支持Panoptic segmentation to TensorRT:不支持Panoptic segmentation to OpenVINO:不支持Panoptic segmentation to Paddle:不支持Panoptic segmentation to MNN:不支持Panoptic segmentation to RKNN:不支持Panoptic segmentation to ncnn:不支持Panoptic segmentation to TFLite:不支持Panoptic segmentation to CoreML:不支持Panoptic segmentation to Core AI:不支持

目前只有语义任务能导出:实例分割和全景分割调用 export() 会得到 NotImplementedError,因为它们的查询掩码输出还没有导出运行时的契约。导出的语义 产物按文件后缀经由 LibreYOLO() 重新加载,所以一个 .onnx 或 .engine 文件的 表现和检查点一样,返回同样的 Results。

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreEoMTl-sem.pt")model.export(format="onnx")model.export(format="tensorrt", half=True)
CLI
libreyolo export model=LibreEoMTl-sem.pt format=onnxlibreyolo export model=LibreEoMTl-sem.pt format=tensorrt half=True
使用导出的文件
from libreyolo import LibreYOLO, SAMPLE_IMAGE # 工厂按文件后缀分发,所以导出的产物加载方式和任何检查点一样,# 返回的也是同一个 Results 对象model = LibreYOLO("LibreEoMTl-sem.onnx")result = model(SAMPLE_IMAGE) print(result.semantic_mask.data.shape)

检查点

这个家族已发布的全部权重文件。

文件权重许可
Semantic segmentation
LibreEoMTl-sem.ptmit
Instance segmentation
LibreEoMTl-seg.ptmit
LibreEoMTl-seg-1280.ptmit
Panoptic segmentation
LibreEoMTs-panoptic.ptmit
LibreEoMTb-panoptic.ptmit
LibreEoMTl-panoptic.ptmit

上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。

许可证

请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。

这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。

原始工作
EoMT, TU Eindhoven, Mobile Perception Systems Lab
上游许可
MIT
LibreYOLO 代码
MIT
权重
采用 MIT 许可,重新发布在 huggingface.co/LibreYOLO
解读
MIT is a permissive license, so this code and these weights can be used in commercial and closed-source products. It asks only that you keep the copyright and license notice with any copy you redistribute. LibreYOLO ships only the DINOv2-backed EoMT checkpoints, sizes s/b/l; the DINOv3 EoMT variants are excluded because they depend on gated non-commercial DINOv3 weights. DINOv2 itself is Apache-2.0. The semantic checkpoint is trained on ADE20K and the instance and panoptic checkpoints on COCO; both are research datasets, and users remain responsible for dataset-license compliance when validating or fine-tuning against them.

引用

@inproceedings{kerssies2025eomt,
  author    = {Kerssies, Tommie and Cavagnero, Niccol\`{o} and Hermans, Alexander and Norouzi, Narges and Averta, Giuseppe and Leibe, Bastian and Dubbelman, Gijs and {de Geus}, Daan},
  title     = {{Your ViT is Secretly an Image Segmentation Model}},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2025},
}

复制自作者在 github.com/tue-mps/eomt#bibtex-citation 上提供的引用块。

已针对 LibreYOLO v1.5.0 验证。本页的支持表、检查点和基准测试数据由已发布的库和权重生成,并非手工编写。

选择具体变体或系列概览,然后选择模块查看详情。打开完整架构图可缩放或下载 SVG 和 PNG。图中标签为英文。