Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection 论文初读

Abstract

In this paper, we present an open-set object detector, called Grounding DINO, by marrying Transformer-based detector DINO with grounded pre-training, which can detect arbitrary objects with human inputs such as category names or referring expressions. The key solution of openset object detection is introducing language to a closed-set detector for open-set concept generalization. To effectively fuse language and vision modalities, we conceptually divide a closed-set detector into three phases and propose a tight fusion solution, which includes a feature enhancer, a language-guided query selection, and a cross-modality decoder for cross-modality fusion. While previous works mainly evaluate open-set object detection on novel categories, we propose to also perform evaluations on referring expression comprehension for objects specified with attributes. Grounding DINO performs remarkably well on all three settings, including benchmarks on COCO, LVIS, ODinW, and RefCOCO/+/g. Grounding DINO achieves a 52.5 AP on the COCO detection zero-shot transfer benchmark, i.e., without any training data from COCO. After finetuning with COCO data, Grounding DINO reaches 63.0 AP. It sets a new record on the ODinW zero-shot benchmark with a mean 26.1 AP. Code will be available at https://github.com/IDEA-Research/GroundingDINO.
在本文中,我们通过将基于变换器的检测器 DINO 与接地预训练相结合,提出了一种名为接地 DINO 的开放集对象检测器,它可以通过类别名称或引用表达等人工输入来检测任意对象。开放集对象检测的关键解决方案是在封闭集检测器中引入语言,以实现开放集概念泛化。为了有效地融合语言和视觉模式,我们从概念上将封闭集检测器分为三个阶段,并提出了一个紧密的融合解决方案,其中包括特征增强器、语言引导的查询选择和用于跨模式融合的跨模式解码器。以往的工作主要是对新类别的开放集对象检测进行评估,而我们建议同时对带有属性的对象的引用表达理解进行评估。接地 DINO 在所有三种设置中都表现出色,包括 COCO、LVIS、ODinW 和 RefCOCO/+/g 的基准测试。接地型 DINO 在 COCO 检测零镜头传输基准(即没有 COCO 的任何训练数据)上的得分达到了 52.5 分。在使用 COCO 数据进行微调后,Grounding DINO 达到了 63.0 AP。它以平均 26.1 AP 的成绩刷新了 ODinW 零点传输基准的记录。代码见 https://github.com/IDEA-Research/GroundingDINO。

Summary

提出的创新点

  • 使用闭集检测器DINO,通过在多个阶段执行视觉语言模态融合扩展到开集检测。其中包括
### ComfyUI与Grounding-DINO集成指南 #### 一、环境搭建 对于希望利用最新功能并享受稳定性能体验的开发者来说,推荐通过下载源码来构建项目[^1]。此过程涉及使用 `pip` 安装必要的依赖库。针对特定组件如lap库可能出现的安装失败情况,建议查阅网络资源获取解决办法。 为了启用 GPU 加速特性,需特别注意安装与 CUDA 版本相匹配的要求文件(requirements*-gpu.txt),特别是调整其中关于 onnxruntime-gpu 的版本号以确保兼容性。 ```bash # 下载源码后进入项目目录 cd path_to_project_directory # 创建虚拟环境 (可选) python -m venv env source env/bin/activate # Linux/MacOS .\env\Scripts\activate # Windows # 安装基础依赖项 pip install -r requirements.txt # 若需要GPU支持,则应改为如下命令 pip install -r requirements-gpu.txt ``` #### 二、ComfyUI简介及其配置 ComfyUI 是一款用于简化AI应用开发流程的强大工具。它允许用户轻松创建复杂的图形界面应用程序而无需深入了解底层细节。当考虑将其与 Grounding-DINO 结合时,主要关注点在于如何有效地加载预训练模型以及处理输入输出数据流。 #### 三、Grounding-DINO概述及应用场景 Grounding-DINO是一种先进的视觉理解框架,在图像标注任务上表现出色。其核心优势在于能够精准定位图片内的目标对象,并提供详细的描述信息。这使得该技术非常适合应用于自动化内容审核、智能检索等领域[^2]。 #### 四、实例展示:基于ComfyUI实现简单的物体检测程序 下面给出一段Python代码片段作为例子,展示了怎样借助ComfyUI快速建立一个简易版的对象识别器: ```python from comfyui import App, ImageInput, TextOutput import grounding_dino as gd app = App() @app.route("/") def index(): img_input = ImageInput(label="上传一张照片") @img_input.on_submit() def handle_image(image_path): result = gd.detect_objects(image_path=image_path) output_text = "\n".join([f"{obj['label']}: {round(obj['confidence'], 2)}%" for obj in result]) return {"output": [{"type": "text", "value": output_text}]} if __name__ == "__main__": app.run(debug=True) ``` 上述脚本定义了一个Web服务端口,接收来自用户的图片提交请求并通过调用 Grounding-DINO API 进行分析;最后返回检测到的目标列表给前端页面显示。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值