Contents Menu Expand Light mode Dark mode Auto light/dark mode
OFASys documentation
OFASys documentation

Getting Started

  • OFASys
  • Installation
  • Usage in 15 minutes

How-To Guides

  • Define a Task
  • Train a Task
  • Add a Custom Module

Conceptual Guides

  • Philosophy
  • Core Concepts

Task Gallery

  • Text-Only Tasks
  • Image-Related Tasks
  • Box-Related Tasks
  • Video-Related Tasks
  • Audio-Related Tasks
  • Structural Language Tasks
  • Motion-Related Tasks

API Reference

  • Model
  • Adaptor
  • Preprocessor
  • Criterion
  • Task
  • Instruction
  • Generator
  • Utils
  • Hub Interface
Back to top
Edit this page

Box-Related Tasks#

RefCOCO Visual Grounding#

Task Introduction#

Visual Grounding requires the model to locate an image region according to a text query. OFASys formulate this task as a sequence-to-sequence generation task. In detail, given an image and query, OFASys generates the box sequence (e.g., <x1,y1,x2,y2>) in an autoregressive manner. We perform experiments on RefCOCO, RefCOCO+, and RefCOCOg. We report the metric Acc@0.5 on the corresponding validation and test sets.

Default Template#

[IMAGE:img] which region does the text "[TEXT:cap]" describe? -> [BOX:patch_boxes]

Usage#

>>> instruction = '[IMAGE:img] which region does the text " [TEXT:cap] " describe? -> [BOX:patch_boxes]'
>>> data = {'img': "https://www.2008php.com/2014_Website_appreciate/2015-06-22/20150622131649.jpg", 'cap': 'hand'}
>>> output = model.inference(instruction, data=data)
>>> output.save_box('0.jpg')

CASE#

input:

https://www.2008php.com/2014_Website_appreciate/2015-06-22/20150622131649.jpg

output:

http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/examples/inference_caption_0.jpg

Grounded Image Captioning#

Task Introduction#

Grounded image captioning is an inverse task of visual grounding. Given an image and a region, the model requires to generate a description about the region. We use RefCOCO, RefCOCO+, RefCOCOg, and Visual Genome as the pretraining datasets for this task.

Default Template#

[IMAGE:img] what does the region describe? region: [BOX:patch_boxes] -> [TEXT:cap]

Object Detection#

Task Introduction#

Object detection is a common vision task that requires a model to recognize all objects in the image and localize their regions. We use OpenImages, Object365, Visual Genome, and COCO as the pretraining datasets for this task.

Default Template#

[IMAGE:img] what are the objects in the image? -> ( [BOX] [TEXT])*
Next
Video-Related Tasks
Previous
Image-Related Tasks
Copyright © 2022, OFA-Sys
Made with Sphinx and @pradyunsg's Furo
On this page
  • Box-Related Tasks
    • RefCOCO Visual Grounding
      • Task Introduction
      • Default Template
      • Usage
      • CASE
    • Grounded Image Captioning
      • Task Introduction
      • Default Template
    • Object Detection
      • Task Introduction
      • Default Template