前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Recognize_Anything-Tag2Text——一款强大的图像标签模型和Tag2Text

Recognize_Anything-Tag2Text——一款强大的图像标签模型和Tag2Text

作者头像
山行AI
发布2023-06-14 16:20:27
1.8K0
发布2023-06-14 16:20:27
举报
文章被收录于专栏:山行AI山行AI

前言

官方 PyTorch 实现了Recognize Anything 模型(RAM)[1]和Tag2Text 模型[2]。

•RAM 是一款强大的图像标签模型,能够以高准确度识别任何常见类别。•Tag2Text 是一种高效且可控的视觉-语言模型,通过标签引导生成文本描述。

当与Grounded-SAM模型(Grounded-SAM[3])结合使用时,Tag2Text 和 RAM 构成了一个强大且通用的视觉语义分析流程。

废话不多说,先直接上体验结果:

体验地址:https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text

看过笔者文章的同学应该已经发现,之前也有介绍过一款有类似功能的项目:

MiniGPT-4:使用先进的大型语言模型提升视觉语言理解

本项目的github地址为:GitHub - xinyu1205/Recognize_Anything-Tag2Text: Code for the Recognize Anything Model and Tag2Text Model[4]

label Recognize Anything:一款强大的图像标签模型和Tag2Text(通过图像标签指导视觉-语言模型)

官方 PyTorch 实现了Recognize Anything 模型(RAM)[5]和Tag2Text 模型[6]。

•RAM 是一款强大的图像标签模型,能够以高准确度识别任何常见类别。•Tag2Text 是一种高效且可控的视觉-语言模型,通过标签引导生成文本描述。

当与Grounded-SAM模型(Grounded-SAM[7])结合使用时,Tag2Text 和 RAM 构成了一个强大且通用的视觉语义分析流程。

有用的教程

•mushroom: [尝试我们的 RAM & Tag2Text 网页演示!🤗[8]]•apple: [访问 RAM 主页[9]]•grapes: [访问 Tag2Text 主页[10]]•sunflower: [阅读 RAM arXiv 论文[11]]•rose: [阅读 Tag2Text arXiv 论文[12]]

亮点

识别和定位是计算机视觉的两个基础任务。

Segment Anything 模型(SAM)定位能力 上表现出色,但在 识别任务 上表现较差。•Recognize Anything 模型(RAM)和 Tag2Text 展示了出色的识别能力,无论是在 准确性 还是 范围 方面。

Tag2Text 用于视觉-语言任务:标签化。 在没有手动注释的情况下,Tag2Text 在3,429[13]个常见人类使用的类别的图像标签识别能力方面表现出色。

高效。 标签引导有效提升了视觉-语言模型在基于生成和基于对齐的任务上的性能。 •可控。 Tag2Text 允许用户输入 期望的标签,从而根据输入的标签灵活地组合相应的文本。

RAM 在 Tag2Text 上的进展:准确性。 RAM 利用数据引擎生成额外的注释并清理不正确的注释,相比于 Tag2Text,RAM 具有更高的准确性。

范围。 Tag2Text 可识别超过 3,400 个固定标签。RAM 将该数字升级到了 6,400+,涵盖了更多有价值的类别。通过开放集能力,RAM 能够识别任何常见的类别。

其他重要项目

•Tag2Text/RAM with Grounded-SAM[14] 是一个强大且通用的视觉语义分析流水线,可以自动进行图像的识别检测分割!•Ask-Anything[15] 是一个多功能的视频问答工具。Tag2Text 提供了强大的标注和字幕能力作为其基本组件。•Prompt-can-anything[16] 是一个集成了 SOTA 多模态大模型的 gradio web 库,其中包括 Tag2Text 作为图形理解的核心模型。

新闻动态

2023/06/08: 我们发布了 Recognize Anything Model (RAM) Tag2Text web demo 🤗[17]、检查点和推理代码!•2023/06/07: 我们发布了 Recognize Anything Model (RAM)[18],一个强大的图像标记模型!•2023/06/05: Tag2Text 与 Prompt-can-anything[19] 结合使用。•2023/05/20: Tag2Text 与 VideoChat[20] 结合使用。•2023/04/20: 我们将 Tag2Text 与 Grounded-SAM[21] 结合使用。•2023/04/10: 代码和检查点现已可用!•2023/03/14: Tag2Text web demo 🤗[22] 现在在 Hugging Face Space 上可用!

待办事项

• 发布 Tag2Text 演示。• 发布检查点。• 发布推理代码。• 发布 RAM 演示和检查点。• 发布训练代码(最晚于7月8日之前)。• 发布训练数据集(最晚于7月15日之前)。

检查点

名称

骨干网络

数据

说明

检查点

1

RAM-Swin

Swin-Large

COCO, VG, SBU, CC-3M, CC-12M

演示版本能够以高精度识别任何常见类别。

下载链接

2

Tag2Text-Swin

Swin-Base

COCO, VG, SBU, CC-3M, CC-12M

带有全面标题的演示版本。

下载链接

模型推断

RAM 推断

1.安装依赖项,运行:

代码语言:javascript
复制
pip install -r requirements.txt

1.下载 RAM 预训练检查点。2.获取图像的英文和中文输出:

代码语言:javascript
复制
python inference_ram.py --image images/1641173_2291260800.jpg \
  --pretrained pretrained/ram_swin_large_14m.pth

RAM 零样本推断即将到来!

Tag2Text 推断

1.安装依赖项,运行:

代码语言:javascript
复制
pip install -r requirements.txt

1.下载 Tag2Text 预训练检查点。2.获取标签和标题结果:

代码语言:javascript
复制
python inference_tag2text.py --image images/1641173_2291260800.jpg \
  --pretrained pretrained/tag2text_swin_14m.pth

或者获取标签和指定的标题结果(可选):

代码语言:javascript
复制
python inference_tag2text.py --image images/1641173_2291260800.jpg \
  --pretrained pretrained/tag2text_swin_14m.pth \
  --specified-tags "cloud,sky"

引用

如果您发现我们的工作对您的研究有用,请考虑引用。

代码语言:javascript
复制
@misc{zhang2023recognize,
  title={Recognize Anything: A Strong Image Tagging Model}, 
  author={Youcai Zhang and Xinyu Huang and Jinyu Ma and Zhaoyang Li and Zhaochuan Luo and Yanchun Xie and Yuzhuo Qin and Tong Luo and Yaqian Li and Shilong Liu and Yandong Guo and Lei Zhang},
  year={2023},
  eprint={2306.03514},
  archivePrefix={arXiv},
  primaryClass={cs.CV}
}

@article{huang2023tag2text,
  title={Tag2Text: Guiding Vision-Language Model via Image Tagging},
  author={Huang, Xinyu and Zhang, Youcai and Ma, Jinyu and Tian, Weiwei and Feng, Rui and Zhang, Yuejie and Li, Yaqian and Guo, Yandong and Zhang, Lei},
  journal={arXiv preprint arXiv:2303.05657},
  year={2023}
}

致谢

本工作得到了 BLIP[23] 令人惊叹的代码基础的帮助,非常感谢!

我们还要感谢 @Cheng Rui @Shilong Liu @Ren Tianhe 在 将 Tag2Text 与 Grounded-SAM 结合[24] 中的帮助。

References

[1] Recognize Anything 模型(RAM): https://recognize-anything.github.io/ [2] Tag2Text 模型: https://tag2text.github.io/ [3] Grounded-SAM: https://github.com/IDEA-Research/Grounded-Segment-Anything [4] GitHub - xinyu1205/Recognize_Anything-Tag2Text: Code for the Recognize Anything Model and Tag2Text Model: https://github.com/xinyu1205/Recognize_Anything-Tag2Text [5] Recognize Anything 模型(RAM): https://recognize-anything.github.io/ [6] Tag2Text 模型: https://tag2text.github.io/ [7] Grounded-SAM: https://github.com/IDEA-Research/Grounded-Segment-Anything [8] 尝试我们的 RAM & Tag2Text 网页演示!🤗: https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text [9] 访问 RAM 主页: https://recognize-anything.github.io/ [10] 访问 Tag2Text 主页: https://tag2text.github.io/ [11] 阅读 RAM arXiv 论文: https://arxiv.org/abs/2306.03514 [12] 阅读 Tag2Text arXiv 论文: https://arxiv.org/abs/2303.05657 [13] 3,429: ./data/tag_list.txt [14] Tag2Text/RAM with Grounded-SAM: https://github.com/IDEA-Research/Grounded-Segment-Anything [15] Ask-Anything: https://github.com/OpenGVLab/Ask-Anything [16] Prompt-can-anything: https://github.com/positive666/Prompt-Can-Anything [17] Recognize Anything Model (RAM) Tag2Text web demo 🤗: https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text [18] Recognize Anything Model (RAM): https://recognize-anything.github.io/ [19] Prompt-can-anything: https://github.com/OpenGVLab/Ask-Anything [20] VideoChat: https://github.com/OpenGVLab/Ask-Anything [21] Grounded-SAM: https://github.com/IDEA-Research/Grounded-Segment-Anything [22] Tag2Text web demo 🤗: https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text [23] BLIP: https://github.com/salesforce/BLIP [24] 将 Tag2Text 与 Grounded-SAM 结合: https://github.com/IDEA-Research/Grounded-Segment-Anything

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2023-06-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 山行AI 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • label Recognize Anything:一款强大的图像标签模型和Tag2Text(通过图像标签指导视觉-语言模型)
    • 有用的教程
      • 亮点
        • 其他重要项目
          • 新闻动态
            • 待办事项
              • 检查点
                • 模型推断
                  • RAM 推断
                  • Tag2Text 推断
                • 引用
                  • 致谢
                    • References
                相关产品与服务
                图像标签
                图像标签采用腾讯云前沿图片分类和物体检测算法,可识别图片中出现的各种物体或场景等,返回具体名称和所属类别,覆盖日常物品、场景、动物、植物、食物、饮品、交通工具等多个大类,数百个细分类目,数千个具体标签。广泛应用于拍照识物、场景分析、内容推荐与审核、智能相册分类等场景。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档