官方 PyTorch 实现了Recognize Anything 模型(RAM)[1]和Tag2Text 模型[2]。
•RAM 是一款强大的图像标签模型,能够以高准确度识别任何常见类别。•Tag2Text 是一种高效且可控的视觉-语言模型,通过标签引导生成文本描述。
当与Grounded-SAM模型(Grounded-SAM[3])结合使用时,Tag2Text 和 RAM 构成了一个强大且通用的视觉语义分析流程。
废话不多说,先直接上体验结果:
体验地址:https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text
看过笔者文章的同学应该已经发现,之前也有介绍过一款有类似功能的项目:
本项目的github地址为:GitHub - xinyu1205/Recognize_Anything-Tag2Text: Code for the Recognize Anything Model and Tag2Text Model[4]
官方 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 | 带有全面标题的演示版本。 | 下载链接 |
1.安装依赖项,运行:
pip install -r requirements.txt
1.下载 RAM 预训练检查点。2.获取图像的英文和中文输出:
python inference_ram.py --image images/1641173_2291260800.jpg \
--pretrained pretrained/ram_swin_large_14m.pth
RAM 零样本推断即将到来!
1.安装依赖项,运行:
pip install -r requirements.txt
1.下载 Tag2Text 预训练检查点。2.获取标签和标题结果:
python inference_tag2text.py --image images/1641173_2291260800.jpg \
--pretrained pretrained/tag2text_swin_14m.pth
或者获取标签和指定的标题结果(可选):
python inference_tag2text.py --image images/1641173_2291260800.jpg \
--pretrained pretrained/tag2text_swin_14m.pth \
--specified-tags "cloud,sky"
如果您发现我们的工作对您的研究有用,请考虑引用。
@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] 中的帮助。
[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