如果你想找出某个物体在图片上的位置,你只需要输入对这个物体的描述,比如“a blue turtle-like pokemon with round head”, OFA模型便能框出它的所在位置。本页面右侧提供了在线体验的服务,欢迎使用!
本系还有如下模型,欢迎试用:
玩转OFA只需区区以下数行代码,就是如此轻松!如果你觉得还不够方便,请点击右上角Notebook
按钮,我们为你提供了配备好的环境(可选CPU/GPU),你只需要在notebook里输入提供的代码,就可以把OFA玩起来了!
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.outputs import OutputKeys
ofa_pipe = pipeline(
Tasks.visual_grounding,
model='damo/ofa_visual-grounding_refcoco_large_en')
image = 'https://xingchen-data.oss-cn-zhangjiakou.aliyuncs.com/maas/visual-grounding/visual_grounding.png'
text = 'a blue turtle-like pokemon with round head'
input = {'image': image, 'text': text}
result = ofa_pipe(input)
print(result[OutputKeys.BOXES])
OFA(One-For-All)是通用多模态预训练模型,使用简单的序列到序列的学习框架统一模态(跨模态、视觉、语言等模态)和任务(如图片生成、视觉定位、图片描述、图片分类、文本生成等),详见我们发表于ICML 2022的论文:OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework,以及我们的官方Github仓库https://github.com/OFA-Sys/OFA。
Github  |  Paper   |  Blog
Model | Params-en | Params-zh | Backbone | Hidden size | Intermediate size | Num. of heads | Enc layers | Dec layers |
---|---|---|---|---|---|---|---|---|
OFATiny | 33M | - | ResNet50 | 256 | 1024 | 4 | 4 | 4 |
OFAMedium | 93M | - | ResNet101 | 512 | 2048 | 8 | 4 | 4 |
OFABase | 180M | 160M | ResNet101 | 768 | 3072 | 12 | 6 | 6 |
OFALarge | 470M | 440M | ResNet152 | 1024 | 4096 | 16 | 12 | 12 |
OFAHuge | 930M | - | ResNet152 | 1280 | 5120 | 16 | 24 | 12 |
OFA在视觉定位任务的经典公开数据集RefCOCO、RefCOCO+、RefCOCOg均取得当前最优表现,具体结果如下:
Task | RefCOCO | RefCOCO+ | RefCOCOg |
---|---|---|---|
Metric | Acc@0.5 | ||
Split | val / test-a / test-b | val / test-a / test-b | val-u / test-u |
OFABase | 88.48 / 90.67 / 83.30 | 81.39 / 87.15 / 74.29 | 82.29 / 82.31 |
OFALarge | 90.05 / 92.93 / 85.26 | 85.80 / 89.87 / 79.22 | 85.89 / 86.55 |
OFAHuge | 92.04 / 94.03 / 88.44 | 87.86 / 91.70 / 80.71 | 88.07 / 88.78 |
本模型训练数据集是refcoco数据集。
finetune能力请参考OFA Tutorial 1.4节。
训练数据集自身有局限,有可能产生一些偏差,请用户自行评测后决定如何使用。
如果你觉得OFA好用,喜欢我们的工作,欢迎引用:
@article{wang2022ofa,
author = {Peng Wang and
An Yang and
Rui Men and
Junyang Lin and
Shuai Bai and
Zhikang Li and
Jianxin Ma and
Chang Zhou and
Jingren Zhou and
Hongxia Yang},
title = {OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence
Learning Framework},
journal = {CoRR},
volume = {abs/2202.03052},
year = {2022}
}