FlowSeek
FlowSeek 是 Poggi 和 Tosi 提出的光流网络(ICCV 2025),它在 SEA-RAFT 风格的循环网络上加入了一个冻结的 Depth Anything V2 编码器和由深度推导出的运动基。LibreYOLO 移植了它的四个尺寸;t 和 s 采用 Apache-2.0 许可,m 和 l 仅限非商用。
FlowSeek 从一个深度基础模型借来几何知识:Depth Anything V2 编码器的特征和一组由深度计算出的运动基会输入到循环光流更新中。托管的检查点(checkpoint)是上游最终的通用微调版本(TartanAir、Chairs、Things,然后是混合 Sintel、KITTI、HD1K 和 Things 的阶段),也就是上游在 Spring 和 LayeredFlow 上评估的那一个。商用项目选 t 或 s;m 和 l 带有一个非商用的编码器。
安装
FlowSeek 不需要任何可选 extra。它导入的一切都在基础安装里。
pip install libreyolo预测
权重在首次使用时从 LibreYOLO 的 Hugging Face 组织下载。如果你更想直接构建模型,libreyolo 也导出了 LibreFlowSeek 类。
from libreyolo import LibreYOLO model = LibreYOLO("LibreFlowSeekt-flow.pt") # 权重在首次使用时下载results = model(["frame_0001.jpg", "frame_0002.jpg"]) flow = results[0].flowprint(flow.data.shape) # (H, W, 2) float32,(dx, dy) 以像素为单位print(flow.mean_magnitude) # 平均位移,单位为像素from libreyolo import LibreYOLO model = LibreYOLO("LibreFlowSeekt-flow.pt") # N 帧给出 N - 1 个结果;第 i 个结果是从第 i 帧到第 i + 1 帧的光流for result in model("video.mp4", stream=True, save=True, save_flow=True): print(result.flow.max_magnitude)libreyolo predict model=LibreFlowSeekt-flow.pt source=frame_0001.jpg,frame_0002.jpg save=truelibreyolo predict model=LibreFlowSeekt-flow.pt source=video.mp4 save=true arrows=true save_flow=true光流至少需要两帧:只传一张图像会报错。图像列表、按文件名排序的目录、视频或流都算作一个序列,N 帧给出 N - 1 个结果。result.flow 是一个 FlowField,带有一个位于第一帧原始画布上的 (H, W, 2) float32 数组;flow.data[y, x] 是以像素为单位的 (dx, dy),+x 向右,+y 向下。FlowSeek 不填充置信度图,所以 flow.confidence 为 None。result.boxes 为 None。save=True 写出 Middlebury 色轮图,arrows=True 或 warp=True 选择其他视图,save_flow=True 还会把每对帧的原始光流场写成 .flo 文件。光流任务页面完整介绍了载荷和各种视图。
变体
上游训练了两个网络;s 和 l 沿用 t 和 m 的权重,只是细化迭代次数更多,与上游的评估配置一致。
| 尺寸 | 上下文网络 | Depth Anything V2 编码器 | 迭代次数 | 权重许可证 |
|---|---|---|---|---|
t | ResNet-18 | ViT-S | 4 | Apache-2.0 |
s | ResNet-18 | ViT-S | 12 | Apache-2.0 |
m | ResNet-34 | ViT-B | 4 | CC BY-NC 4.0,非商用 |
l | ResNet-34 | ViT-B | 12 | CC BY-NC 4.0,非商用 |
文件名为 LibreFlowSeek<size>-flow.pt。LibreFlowSeek 默认使用尺寸 m,所以如果你需要可商用的权重,请显式传入 t 或 s 检查点。推理在原生分辨率上运行,在网络内部填充到 8 的倍数,填充后画布的每条边都必须至少 128 px。imgsz 限制长边。
不提供训练:train() 会抛出 NotImplementedError。
验证
val() 在光流数据集上运行共用的光流验证器(每个序列一个文件夹存放帧,真值(ground truth)为 Middlebury .flo、KITTI 16 位 PNG 或 .npy;见数据集格式)。它报告平均端点误差 metrics/epe、metrics/px1 和 metrics/px3(误差在 1 px 和 3 px 以内的有效像素占比),以及 KITTI 离群率 metrics/fl_all。
from libreyolo import LibreYOLO model = LibreYOLO("LibreFlowSeekt-flow.pt")metrics = model.val(data="my_flow.yaml") print(metrics["metrics/epe"]) # 平均端点误差,单位为像素print(metrics["metrics/px1"]) # 误差小于 1 px 的像素占比print(metrics["metrics/fl_all"]) # KITTI 离群率libreyolo val model=LibreFlowSeekt-flow.pt data=my_flow.yaml导出
| 任务 | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | Axelera | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Optical flow | Optical flow to ONNX:不支持 | Optical flow to TorchScript:不支持 | Optical flow to ExecuTorch:不支持 | Optical flow to TensorRT:不支持 | Optical flow to OpenVINO:不支持 | Optical flow to Paddle:不支持 | Optical flow to MNN:不支持 | Optical flow to RKNN:不支持 | Optical flow to Axelera:不支持 | Optical flow to ncnn:不支持 | Optical flow to TFLite:不支持 | Optical flow to CoreML:不支持 | Optical flow to Core AI:不支持 |
目前还不支持导出任何格式。在某个家族实现光流任务的双输入计算图(image1、image2)和后端向量重缩放约定之前,光流导出都无法进行。
检查点
这个家族已发布的全部权重文件。
| 文件 | 权重许可 |
|---|---|
| Optical flow | |
| LibreFlowSeekt-flow.pt | apache-2.0 |
| LibreFlowSeeks-flow.pt | apache-2.0 |
| LibreFlowSeekm-flow.pt | cc-by-nc-4.0 |
| LibreFlowSeekl-flow.pt | cc-by-nc-4.0 |
上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。
许可证
请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。
这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。
- 原始工作
- FlowSeek, University of Bologna
- 上游许可
- Apache-2.0 (t and s checkpoints); CC-BY-NC-4.0 (m and l checkpoints)
- LibreYOLO 代码
- MIT
- 权重
- 采用 Apache-2.0 (t and s checkpoints); CC-BY-NC-4.0 (m and l checkpoints) 许可,重新发布在 huggingface.co/LibreYOLO
- 解读
- The two checkpoint licenses are not interchangeable. Each FlowSeek checkpoint embeds a Depth Anything V2 encoder. The t and s checkpoints (one network, s runs 12 refinement iterations instead of 4) embed the ViT-S encoder and are Apache-2.0: they can be used in commercial and closed-source products, with the license text and attribution notices kept on redistribution. The m and l checkpoints embed the ViT-B encoder, which is CC BY-NC 4.0, so they are non-commercial and need attribution; treat them as research weights. Upstream publishes no separate checkpoint license, so the repository's Apache-2.0 license is applied as an implied grant, limited by the encoder license. The code at commit ba640737 is Apache-2.0 with BSD-3-Clause parts from SEA-RAFT, vendored under libreyolo/models/flowseek/_vendor/; LibreYOLO's wrapper code is MIT. Weights come from the upstream get_weights.sh links and are mirrored on the LibreYOLO Hugging Face org, the m and l cards with a non-commercial banner, without gating. Training is out of scope.
FlowSeek 是博洛尼亚大学的 Poggi 和 Tosi 的工作。它的代码采用 Apache-2.0 许可,其中来自 SEA-RAFT 的部分采用 BSD-3-Clause 许可,已内置在 LibreYOLO 中。
检查点的许可证取决于尺寸,因为每个检查点都内嵌了一个 Depth Anything V2 编码器:
t和s内嵌 ViT-S 编码器,采用 Apache-2.0 许可:允许商用和闭源使用。m和l内嵌 ViT-B 编码器,它采用 CC BY-NC 4.0 许可:仅限非商用,需要署名。它们的模型卡带有非商用提示横幅,LibreYOLO 在加载时会打印一条提示。
上游没有单独发布检查点许可证,所以仓库的 Apache-2.0 许可被当作默示授予来适用,并受编码器许可证的限制。这些权重镜像在 LibreYOLO 的 Hugging Face 组织上,不需要申请访问。
引用
@InProceedings{Poggi_2025_ICCV,
author = {Poggi, Matteo and Tosi, Fabio},
title = {FlowSeek: Optical Flow Made Easier with Depth Foundation Models and Motion Bases},
booktitle = {Proceedings of the International Conference on Computer Vision (ICCV)},
year = {2025},
}复制自作者在 github.com/mattpoggi/flowseek 上提供的引用块。