Code Monkey home page Code Monkey logo

vist_api's Introduction

VIST API

fork from lichengunc/vist_api

This API is used to load Visual StoryTelling Dataset (VIST). The dataset currently contains Description-in-Isolation (DII) and Story-in-Sequence (SIS) annotations.

Setup Google API client

download.py is rewritten by Mr.Blue with the google Drive API v3. It downloads the dataset from the google drive based on file_list.txt and saves files in the out_dir directory (default is ./vist). download.py supports resume download and check the sha1sum of the downloaded files. Befor running download.py, you need to setup the google API client. Please follow the instructions below to setup the google API client.

  1. Go to Google API Console and create a new project.
  2. Go to Credentials.
  3. Click "Create credentials" and select "OAuth client ID".
  4. Select "Application type" as "Desktop app" and click "Create".
  5. Click the "download icon" of the newly created client under "OAuth 2.0 Client IDs".
  6. Click "DOWNLOAD JSON" and save the file as credentials.json in the root directory of this repository.
  7. Run pip install -r requirements.txt to install the required packages.
  8. Run python download.py.
  9. Click the link in the terminal and follow the instructions to authorize the application.
  10. If you run python download.py on the remote server, the final jump page in the browser cannot be accessed. In this case, you need to copy the URL from the browser and run curl <URL> in your remote server to complete the authorization.
  11. After the authorization, there will be a file named token.json in the root directory of this repository. Next time you run python download.py, you can skip the authorization step.

References:

Download Dataset

# note the dataset is of big size ~300GB.
python download.py --out_dir ./vist
# Download Description-in-Isolation dataset
wget http://visionandlanguage.net/VIST/json_files/description-in-isolation/DII-with-labels.tar.gz
# Download Story-in-Sequence dataset
wget http://visionandlanguage.net/VIST/json_files/story-in-sequence/SIS-with-labels.tar.gz

Usage

The "vist.py" is able to load both DII and SIS datasets.

# locate your vist_directory, which contains images and annotations
vist_dir = '/playpen/data/vist'
# SIS instance
sis = vist.Story_in_Sequence(vist_dir)
# DII instance
dii = vist.Description_in_Isolation(vist_dir)

vist_api's People

Contributors

hughplay avatar

Stargazers

 avatar

Watchers

 avatar

vist_api's Issues

#File Not Found

Hi! Many thanks for the scripts!

But while i was running download.py to download the files in file_list.txt, a Error404 came up saying that the file is not found on drive/v3. Is it a problem of my maybe not having access to the VIST image files on google drive? Here's the error when downloading the first training set split:
HttpError 404 when requesting https://www.googleapis.com/drive/v3/files/0ByQS_kT8kViSeEpDajIwOUFhaGc?alt=media returned "File not found: 0ByQS_kT8kViSeEpDajIwOUFhaGc.". Details: "[{'domain': 'global', 'reason': 'notFound', 'message': 'File not found: 0ByQS_kT8kViSeEpDajIwOUFhaGc.', 'locationType': 'parameter', 'location': 'fileId'}]">

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.