Home

Awesome

abstract_scenes_v002

<img src="https://s3.amazonaws.com/cvmlp/vqa/abstract_v002/scene_img/img/4.png" alt="Example scene" width="45%"/> <img src="https://s3.amazonaws.com/cvmlp/vqa/abstract_v002/scene_img/img/55.png" alt="Example scene" width="45%"/>

This repo contains the second version of the interface for the Abstract Scenes research project under Larry Zitnick and Devi Parikh.

Scene JSON Format

Every scene is a dictionary/object that has the following keys/fields (and a few more AMT-specific ones if you get the JSON data from AMT):

scene has the following main keys/fields:

object - A dictionary/object that contains three keys:

inst - Contains the actually data for that particular instance of an object, via the following main keys/fields:

For deformable people, they also have the following keys/fields:

Interface Images

To use the web interface (or render scenes in general), you will need to download the images. You can find the majority of the images here. If you need the nondeformable human images (1.5GB) (not needed for the VQA dataset), you can find them here. These images should be placed in a folder called site_pngs/. If you don't feel like downloading the images and know you'll have Internet, you can uncomment the following line in abstract_scenes_v002_head.js:

// baseURLInterface = "https://vision.ece.vt.edu/abstract_scenes_v002/site_pngs/";

Running the Interface Locally

If you are running the interface local (e.g., not on a web server), you can use Python to run a local web server. If you have Python installed properly installed, in a command prompt, you can run python -m SimpleHTTPServer 8000 in the abstract_scenes_v002/ folder. If you haven't configured it well (e.g., it's slightly more complicated on Windows), you can run the code/start_python_web_server.py script, but you'll need to update the directory accordingly in the script. Once the Python HTTP server starts up, you can open a web browser, enter localhost:8000 (or whatever port number you specified), and then navigate to the site/abstract_scenes_v002.html file.

Python Information

This currently is known to work with Python 2.7. As of 2015/03/17, it just uses docopt (installable via pip) and Pillow (installable via pip). To run a basic launch AMT task->download results->process and render results pipeline, there is the example script code/amt_simple_launch/manage_hits.sh.

How to Operate the Interface

Changing Interface Behavior via the URL

Note: QS is short for query string, i.e., the <name>=<value> stuff after the question mark (?) in the URL.

You have 3 ways of using this interface and 2 demos:

  1. Load-scene-from-JSON demo mode by jsonDemo=1
  2. Specify an ordered list of existing scene JSON files to initialize with. E.g., QS has sceneJSON01=AXOOE_01.json&sceneJSON02=AOEUE_11.json
  3. Specify an ordered list of scene types to go through. E.g., QS has sceneType01=Park&sceneType02=Living&sceneType03=Kitchen Note: Kitchen currently doesn't exist
  4. Specify the total number of scenes along with which type of scene. E.g., QS has sceneType=Park&numScene=4 If either one of these are blank, some defaults are used. If both are blank, demo mode.
  5. Blank-scene demo mode by not having anything in the QS (or everything turned off).

This order is also the precedence order (e.g., 1's parameters supercede 3's).

In addition, there are several other QS parameters that you can tweak. You only need to specify these when you want to change from the defaults.

How It Works/Current Setup

Website Files

Image Files

site_pngs/ currently has the interface images (e.g., buttons) in the main folder and then several folders for object categories.

Interface Data Files

There are currently two types of JSON files:

Object Files

A dictionary that contains the following fields:

Scene/Interface Files

The scene configuration (for different scene types) MUST come from a JSON file. By default, it is abstract_scenes_v002_data_scene_config.json, but for your experiments, you probably want to create a new one specific to your project. The sceneConfigFile gets saved into the sceneData that get send back via AMT. The Python script that processes the AMT results file will need those files to exist in the same folder that the interface expects.

A dictionary that contains the following fields:

Adding New Scenes/Tweaked Settings of Existing Scenes

You can add new sceneTypes (e.g., Kitchen) or tweaks of the interface settings for the same general sceneType (e.g., Park) by adding more <sceneType> dictionaries into the configuration file. For tweaks of the same general sceneType (e.g., Park), you can just copy-and-paste and then change the key to be hyphenated (e.g., Park-All). The code will split on hyphens and use the first element to look things up. This way, you don't have to keep adding things everywhere (e.g., you don't need to add Park-All into the objects availableScene list). For example, Park-All is the Park scene with all possible objects. Park-XinleiSubset has the same available objects, but only shows a random subset of each category type. The number of random subsets is consistent with Xinlei's data collection.